user6269864
user6269864

Reputation:

Cannot upgrade Node.js version in Azure App Service

My Azure app service is running Node.js version 0.10:

> node -v
D:\home\site\wwwroot
v0.10.28

I am trying to upgrade it to version 8.

There's an article here describing how to do that: https://learn.microsoft.com/en-us/azure/nodejs-specify-node-version-azure-apps

First, I added the key in the Application Settings in Azure Portal:

Node JS Version in Azure

It didn't work, so I also changed packages.json:

{
  "name": "azure_cosmos_db_webservice",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "start": "node --inspect server.js"
  },
  "engines":{"node": "8.x"}, <-- This line added by me
  "dependencies": {
    "async": "^2.1.2",
    "body-parser": "~1.15.2",
    "cookie-parser": "~1.4.3",
    "debug": "~2.2.0",
    "documentdb": "^1.10.0",
    "dotenv": "^4.0.0",
    "express": "~4.14.0",
    "morgan": "~1.7.0",
    "serve-favicon": "~2.3.0"
  }
}

I've restarted the app service several times by stopping and starting it again.

However, node -v in the console in Azure Portal is still showing the version as 0.10.28.

What did I miss?

Upvotes: 12

Views: 5146

Answers (1)

user6269864
user6269864

Reputation:

Turns out that 8.x was not a correct syntax.

I've changed it to 8.1.4 both in packages.json and in the Application Settings, and it worked.

I found the list of supported versions here:

https://MYSITE.scm.azurewebsites.net/api/diagnostics/runtime

Upvotes: 22

Related Questions