简体   繁体   中英

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

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!

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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