How do I know that my node version is compatible with npm during deployment of azure app service.

Lereko Foloko 20 Reputation points
2023-09-20T02:36:07.89+00:00

So I have been trying to deploy my azure app service and this is the error I have been getting, image

I tried upgrading the node version on both azure and locally but it keeps on failing, I also tried downgrading npm version, still did not go through, on azure app logs there's nothing it's only showing the last deployment that passed, can you please help me with this? it has been blocking me for a while now.

My package.json engines

      "engines": {
        "node": ">=18.17.0 || >=20.5.0",
        "npm": ">=8.19.4"
      }

and node version on azure is 18 as well, since I long got a message that node 16 is deprecated.

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,664 questions
0 comments No comments
{count} votes

Accepted answer
  1. VenkateshDodda-MSFT 19,976 Reputation points Microsoft Employee
    2023-09-20T11:49:56.8766667+00:00

    @Lereko Foloko Thanks for reaching out to Microsoft Q&A, apologize for any inconvenience caused on this.

    Can you try setting the NodeJS runtime version of app service to node:18-LTS by running the below cmdlet from cloud shell.

    For Linux app service:

    az webapp config set --resource-group <resource-group-name> --name <app-name> --linux-fx-version "NODE|18-lts"
    

    If your application is running on windows-based app service plan then you can change the runtime NODEJS version by updating the application setting value WEBSITE_NODE_DEFAULT_VERSION to ~18.

    Once you update the runtime version, I would suggest you login/connect to kudu console (using Advanced tools under Development Tools widget of your webapp in the portal) and check the respective node and npm (node -v, npm-v) runtime versions.

    Since you are using GitHub Actions to build and deploy your application to app service make sure that in your workflows/***.yml file in which agent is using the node 18LTS version for building your application as shown below.

    enter image description here

    For more information about which npm version that particular NodeJS version is using you can refer to this NodeJS official releases documentation.

    Feel free to reach back to me if you have any further questions on this.

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.