Mohamed Said
Mohamed Said

Reputation: 563

Azure Web App using Node 10.x instead of 14.x

I'm using Azure Web Apps and every time I try to make it use node 14.x it resets back to 10.x after every deployment.

When I go to Configuration > General the Stack is blank, I have to select Node and then 14.x to make it work.

Edit: Linux is used not Windows

Upvotes: 0

Views: 1835

Answers (3)

Mr Rogers
Mr Rogers

Reputation: 6261

I realized that even though in Azure Portal I specified the runtime stack... enter image description here

...that I had to go into Configuration and choose the version I wanted again. It defaulted back to 10.

enter image description here

Upvotes: 1

Mohamed Said
Mohamed Said

Reputation: 563

I managed to solve the problem by adding

runtimeStack: "NODE|14-lts"

in the yaml file, 16.x is not yet supported so it defaults back to 10.x

Upvotes: 2

evilSnobu
evilSnobu

Reputation: 26424

Add WEBSITE_NODE_DEFAULT_VERSION app setting for the Node version, but make sure the exact version you fill in is installed on the workers (assuming Windows workers here, since you don't specify) -

https://{yourWebAppName}.scm.azurewebsites.net/api/diagnostics/runtime

That's the Kudu API route returning runtime versions. Pick the latest installed Node version from there.

Your app setting becomes

WEBSITE_NODE_DEFAULT_VERSION = 14.16.0

As long as you don't remove or overwrite this app setting, your Node version will stay consistent across code deployments.

Tracking a GitHub issue here since the documentation page is confusing about the version values - https://github.com/MicrosoftDocs/azure-docs/issues/79475

Upvotes: 1

Related Questions