我正在尝试为我的Azure网站编写自定义部署脚本。我收到一些错误,我认为这些错误与使用较旧版本的Node的Azure有关。
我在网上找到的所有地方都说要在package.json文件中指定节点版本,如下所示:
"engines" : { "node" : "0.10.26" }所以我把它放到我的package.json文件中,但是在推送这些更改之后,日志仍然显示消息:
The package.json file does not specify node.js engine version constraints.
The node.js application will run with the default node.js version 0.10.5.这里发生什么事情?
我的package.json文件:
{ "name": "app-kit", "namespace": "appkit", "APIMethod": "stub", "proxyURL": "http://localhost:8000", "proxyPath": "/api", "version": "0.0.0", "private": true, "directories": { "doc": "doc", "test": "test" }, "engines" : {"node" : "0.10.26"}, "scripts": { "start": "grunt server", "build": "grunt build:debug", "test": "grunt test:ci" }, "repository": { "type": "git", "url": "git://github.com/stefanpenner/ember-app-kit.git" }, "author": "", "license": "MIT", "dependencies" : { "express": "~3.4.8", "lockfile": "~0.4.2", "grunt": "~0.4.2", "grunt-cli": "~0.1.9", "load-grunt-config": "~0.7.0", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-clean": "~0.5.0", "grunt-contrib-jshint": "~0.8.0", "grunt-contrib-uglify": "~0.2.7", "grunt-contrib-cssmin": "~0.6.2", "grunt-preprocess": "~3.0.1", "grunt-es6-module-transpiler": "~0.6.0", "grunt-concat-sourcemap": "~0.4.0", "grunt-concurrent": "~0.4.3", "grunt-usemin": "~0.1.13", "grunt-rev": "~0.1.0", "grunt-ember-templates": "~0.4.18", "originate": "~0.1.5", "grunt-es6-import-validate": "0.0.6", "grunt-contrib-less": "^0.11.0" }, "devDependencies": { "express": "~3.4.8", "lockfile": "~0.4.2", "bower": "~1.2.7", "grunt": "~0.4.2", "grunt-cli": "~0.1.9", "load-grunt-config": "~0.7.0", "grunt-contrib-watch": "~0.5.3", "grunt-contrib-copy": "~0.4.1", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-clean": "~0.5.0", "grunt-contrib-jshint": "~0.8.0", "grunt-contrib-uglify": "~0.2.7", "grunt-contrib-cssmin": "~0.6.2", "grunt-preprocess": "~3.0.1", "grunt-es6-module-transpiler": "~0.6.0", "grunt-concat-sourcemap": "~0.4.0", "grunt-concurrent": "~0.4.3", "grunt-usemin": "~0.1.13", "grunt-rev": "~0.1.0", "grunt-ember-templates": "~0.4.18", "grunt-contrib-testem": "~0.5.14", "express-namespace": "~0.1.1", "request": "~2.33.0", "loom-generators-ember-appkit": "~1.0.5", "originate": "~0.1.5", "loom": "~3.1.2", "connect-livereload": "~0.3.1", "grunt-es6-import-validate": "0.0.6", "grunt-contrib-less": "^0.11.0", "grunt-ftp-deploy": "^0.1.2" } }
我知道在devDependencies和依赖中存在重复,这是不必要的。这是因为我想在azure上构建我的应用程序,但是一些依赖项不能正确安装b/c的C头文件(至少看起来是这样)。我尝试在依赖项中只包含构建应用程序的prod版本所需的那些。如果我能让它在Azure上工作,我计划把它清理干净。
发布于 2015-06-03 10:15:26
我正在尝试使用iojs insetead of node,但我遇到了相同/类似的问题。
请删除启动脚本行,并遵循自定义部署脚本,一切都会好起来的。您可以找到用于运行iojs的部署脚本here。我认为它们可以适用于运行任何节点版本。
我复制了正常节点项目中的所有文件(使用bin/www脚本),但它们不起作用。似乎我需要对该脚本进行一些更改或将其删除,否则,所有事情看起来都可以正常工作。
祝好运,
https://stackoverflow.com/questions/23437799
复制相似问题