简体   繁体   English

在Windows Azure网站上运行哪个版本的node.js?

[英]Which version of node.js is running on Windows Azure Web Sites?

哪个版本的node.js实际上在Windows Azure网站上运行?

There are many versions of node preinstalled on the Windows Azure Web Sites servers and you can choose which one gets used by specifying your minimum required version in your package.json file. Windows Azure网站服务器上预安装了许多版本的节点,您可以通过在package.json文件中指定所需的最低版本来选择使用哪个版本。 Instructions here . 这里的说明。

The versions available change on a regular basis, but to give you a sense, the currently available versions (as of November 1, 2013) is: 0.6.17, 0.6.20, 0.8.2, 0.8.19, 0.8.26, 0.10.5, 0.10.18, 0.10.21. 可用的版本会定期更改,但为了让您有所了解,目前可用的版本(截至2013年11月1日)为:0.6.17,0.6.20,0.8.2,0.8.19,0.8.26, 0.10.5,0.10.18,0.10.21。

It turns out to be, at the moment of writing: v0.6.20 . 事实证明,在写作的那一刻: v0.6.20

Quickly found out via the following script: 通过以下脚本快速找到:

var http = require('http');
http.createServer(function(req, res){
    res.writeHead(200, {'content-type': 'text/plain'})
    res.end('Version - ' + process.version);
}).listen(process.env.port || 1337)

To follow and try it yourself follow these steps . 要自己关注并尝试,请按照以下步骤操作

I found this: http://hardcoded.se/2015/01/07/node-js-version-on-azure-websites/ 我发现了这个: http//hardcoded.se/2015/01/07/node-js-version-on-azure-websites/

In the KUDU environment of your app (accessible through the url deletemesoon.scm.azurewebsites.net if your website has the url deletemesoon.azurewebsites.net) hit runtime versions and you will receive a JSON representation of available versions. 在您的应用程序的KUDU环境中(如果您的网站有url deletemesoon.azurewebsites.net,可通过url deletemesoon.scm.azurewebsites.net访问)点击运行时版本,您将收到可用版本的JSON表示。
Hope this answers your question. 希望这能回答你的问题。

By default 0.6.20 默认为0.6.20

BUT you can set your own version: 但是你可以设置自己的版本:

  1. Upload (ftp) node executable (not the installer!) to bin folder in your wwwroot or wherever you please. 将(ftp)节点可执行文件(不是安装程序!)上传到wwwroot中的 bin文件夹或任何您喜欢的位置。 ie get it from here: http://nodejs.org/dist/v0.10.12/node.exe 即从这里获取它: http//nodejs.org/dist/v0.10.12/node.exe
  2. Add

     nodeProcessCommandLine: "D:\\home\\site\\wwwroot\\bin\\node.exe" 

to iisnode.yml (must be located where your server.js is) iisnode.yml (必须位于server.js所在的位置)

[source: http://www.windowsazure.com/en-us/develop/nodejs/common-tasks/specifying-a-node-version/ ] [来源: http//www.windowsazure.com/en-us/develop/nodejs/common-tasks/specifying-a-node-version/ ]

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

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