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

心不动则不痛 提交于 2020-01-12 17:21:18

问题


Which version of node.js is actually running on Windows Azure Web Sites?


回答1:


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. 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.




回答2:


It turns out to be, at the moment of writing: 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.




回答3:


I found this: 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.
Hope this answers your question.




回答4:


By default 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. i.e. get it from here: 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)

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



来源:https://stackoverflow.com/questions/12697113/which-version-of-node-js-is-running-on-windows-azure-web-sites

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