Azure Website Instance not running defined Node Version in Package.json

依然范特西╮ 提交于 2019-12-08 07:37:43

问题


Currently in Azure I am utilizing a 'Azure Website' instance to try and run Docpad (NodeJS App). Within my package.json file I have the following defined..

"engines": {
  "node": "0.10.21",
  "npm": "1.x"
},

I have tried numerous different entries, from 0.10.x to 0.8.x all listed here => http://azure.microsoft.com/en-us/documentation/articles/nodejs-specify-node-version-azure-apps/

The problem is that Docpad is using Dependencies with Semver Entries and Azure seems to be ignoring my defined Node version entirely, as there are errors such as...

npm WARN engine docpad@6.69.2: wanted: {"node":">=0.8","npm":">=1.2"} (current: {"node":"0.6.20","npm":"1.1.37"})

Because of this, I am getting critical/failure errors when NPM goes to install Docpad due to dependencies such as this...

npm ERR! Error: No compatible version found: rimraf@'^2.2.8'
npm ERR! Valid install targets:
npm ERR! ["1.0.0","1.0.1","1.0.2","1.0.4","1.0.5","1.0.6","1.0.7","1.0.8","1.0.9","2.0.0","2.0.1","2.0.2","2.0.3","2.1.0","2.1.1","2.1.2","2.1.3","2.1.4","2.2.0","2.2.1","2.2.2","2.2.3","2.2.4","2.2.5","2.2.6","2.2.8"]

I have even gone as far as to try printing the Node Version in my deployment script, only to have it return the Environment Variable Azure supposedly honors, but it is clearly invalid.

All I am trying to do is deploy a Docpad website on Azure and I am dumbfounded as to how this is so difficult to to just use a semi-recent version of node in Azure. Any help at all would be greatly appreciated!


回答1:


node and npm are now npm packages that can be installed as dependencies of your project, so it will run with the correct versions once its dependencies are installed.

However, to install those packages you will need to start with newer versions than the ones you have in your engines section:

  • Without npm >= 3 installing the node package will break your system by removing the existing version of node too soon
  • Without node >= 4 the npm package won't work (it isn't specific as to what goes wrong)


来源:https://stackoverflow.com/questions/28257861/azure-website-instance-not-running-defined-node-version-in-package-json

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!