Upgrading Node on an Azure website?

JMK picture JMK · Jan 12, 2016 · Viewed 13.9k times · Source

I'm trying to run some pre deployment tasks (unit tests etc) with NPM on an Azure website, however the version of node on the VM is v0.10.32, the current version of node is v4.2.4.

I have non administrative access to the command line via the SCM website, no RDP etc.

Is there any way to upgrade?

Answer

Shaun Luttin picture Shaun Luttin · Sep 10, 2016

Ensure the Azure Web App has the node version you want.

  1. Go to yoursite.scm.azurewebsites.net
  2. Choose Debug Console (PowerShell or CMD)
  3. Navigate to D:\Program Files (x86)\nodejs
  4. Run dir to see the available nodejs versions.

For instance, if there is a directory named 6.3.0, then you can use it.

// App Setting
WEBSITE_NODE_DEFAULT_VERSION 6.3.0  

// package.json
engines":{"node": "6.3.0"}