简体   繁体   English

Package.json指定节点版本,但Azure告诉我没有指定

[英]Package.json specifies Node version but Azure tells me none is specified

Im trying to write a custom deploy script for my Azure website. 我试图为我的Azure网站编写自定义部署脚本。 I'm getting some errors that I believe are related to Azure using an older version of Node. 我收到了一些我认为与使用较旧版本的Node相关的Azure相关的错误。

All the places I found online say to specify the Node version in your package.json file like so: 我在网上找到的所有地方都说要在你的package.json文件中指定Node版本,如下所示:

"engines" : { "node" : "0.10.26" }

So I put that in my package.json file, but after pushing those changes, the log still shows the message: 所以我把它放在我的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.

What is going on here? 这里发生了什么?

My package.json file: 我的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" } }

I know there is duplication in devDependencies and dependencies which is not necessary. 我知道devDependencies和依赖项中存在重复,这是不必要的。 This was because I want to grunt build my app on azure, but some of the dependencies wouldn't install correctly b/c of C headers (or so it appeared). 这是因为我想在azure上构建我的应用程序,但是一些依赖项无法正确安装C标头的b / c(或者它出现了)。 I tried to include only the ones necessary to build the prod version of the application in the dependencies key. 我试图只包括在依赖项键中构建应用程序的prod版本所必需的那些。 If I can get this working on Azure I plan to clean this up. 如果我能在Azure上工作,我打算清理它。

I'm trying to use iojs insetead of node and I've ran into the same/similar issue. 我试图使用iojs而不是节点,我遇到了相同/类似的问题。

Please remove the start script line and follow the custom deploy scripts and all will be fine. 请删除启动脚本行并按照自定义部署脚本进行操作,一切正常。 You can find deployments scripts here for running iojs. 您可以在此处找到用于运行iojs的部署脚本。 I think they can be adapted to run any node version. 我认为它们可以适应任何节点版本。

I copied all files in my normal node project (with bin/www script) but they did not work. 我复制了我的普通节点项目中的所有文件(使用bin / www脚本)但它们不起作用。 It seems that I need to make some changes to that script or remove it since otherwise, all things look to be working. 似乎我需要对该脚本进行一些更改或删除它,否则,所有事情看起来都有效。

Good luck, 祝好运,

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM