Reputation: 563
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
Reputation: 6261
I realized that even though in Azure Portal I specified the runtime stack...
...that I had to go into Configuration
and choose the version I wanted again. It defaulted back to 10
.
Upvotes: 1
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
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