Azure网站实例未运行Package

Azure网站实例未运行Package

本文介绍了Azure网站实例未运行Package.json中定义的节点版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前在Azure中,我正在利用"Azure网站"实例来尝试并运行Docpad(NodeJS应用程序).在我的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"
},

我尝试了许多不同的条目,从0.10.x到0.8.x都在这里列出=> http://azure.microsoft.com/zh-CN/documentation/articles/nodejs-specify-node-version-azure-apps/

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/

问题是Docpad在Semver条目中使用了依赖项,而Azure似乎完全忽略了我定义的Node版本,因为存在诸如...的错误.

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"})

正因为如此,由于诸如此类的依赖性,当NPM去安装Docpad时,我遇到严重/失败错误.

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"]

我什至尝试在我的部署脚本中打印节点版本,只是让它返回环境变量Azure(据称是荣誉),但这显然是无效的.

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.

我想要做的就是在Azure上部署Docpad网站,而我对于如何仅在Azure中使用半新版本的节点如此困难感到震惊.任何帮助将不胜感激!

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!

推荐答案

节点和 npm 可以作为项目的依赖项安装,因此它将与安装依赖项后,版本正确.

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:

  • 如果没有npm> = 3,则安装节点软件包将通过过早删除节点的现有版本来破坏系统
  • 没有节点> = 4时,npm软件包将无法工作(它不专门指出问题所在)

这篇关于Azure网站实例未运行Package.json中定义的节点版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-07 09:50