I'm running the node server on Azure and need to change the default version of node because it's 0.8.28, or to set the specific version for the app.
At the first time, I thought that I can specify the version using deployment file (deploy.cmd) and package.json like following;
deploy.cmd
:: Force use of the latest NPM
SET NPM_JS_PATH=%ProgramFiles(x86)%\npm\6.12.0\node_modules\npm\bin\npm-cli.js
SET NODE_PATH=%ProgramFiles(x86)%\nodejs\8.9.4\node.exe
package.json
"engines": {
"node": "8.9.4",
"npm": "6.12.0"
},
And when the app is deployed, it shows specified versions are set.
2019-12-05T15:36:17 Selected node.js version 8.9.4. Use package.json file to choose a different version.
2019-12-05T15:36:17 Selected npm version 6.12.0
2019-12-05T15:36:17 Updating iisnode.yml at D:\home\site\wwwroot\App_Data\config\scripts\iisnode.yml
That's why I expected the app will be running on node@8.9.4 but when i consoled process.version, it's still 0.8.28. It looks like the version is being overwritten by default version at the end when it's deployed.
Additionally, I tried to edit WEBSITE_NODE_DEFAULT_VERSION variable in Configuration (Settings > Configuration > WEBSITE_NODE_DEFAULT_VERSION) but I couldn't save because the host name doesn't include "azurewebsites.net".
Is there any way to specify the node version or edit WEBSITE_NODE_DEFAULT_VERSION?