Upgrading Node on an Azure website?
Ensure the Azure Web App has the node version you want.
- Go to yoursite.scm.azurewebsites.net
- Choose Debug Console (PowerShell or CMD)
- Navigate to
D:\Program Files (x86)\nodejs
- Run
dir
to see the available nodejs versions.
For instance, if there is a directory named 6.3.0
, then you can use it.
// App SettingWEBSITE_NODE_DEFAULT_VERSION 6.3.0 // package.jsonengines":{"node": "6.3.0"}
You can specify the version of node that the app is running on using the package.json file. Add:
"engines":{"node":version}
e.g.:
"engines":{"node": "0.12.x"},
More info: https://azure.microsoft.com/en-us/documentation/articles/nodejs-specify-node-version-azure-apps/
2017 update. All above didn't work for me in.
I changed:
// package.jsonengines":{"node": "8.0.0"}
and then I added app settings value
<appSettings> <add key="WEBSITE_NODE_DEFAULT_VERSION" value="8.0.0" /></appSettings>
I restarted an app million times, and the solution was to change iisnode.yml
nodeProcessCommandLine: "D:\Program Files (x86)\nodejs\8.0.0\node.exe"
That's it. I hope it will help someone.
Update
Just to clarify things: I'm talking about App Service
And if you ftp to your App you will see iisnode.yml here: