locked
Please install the latest node with npm 5.6.0 to solve a killer `npm install` issue RRS feed

  • Question

  • Hi team,

    Could we get the latest version of node (LTS or Current) installed for App Services as a lot of us are struggling with an issue on Windows that's fixed in npm 5.6.0 (included with latest version of node). Then I can change my node version app setting to 8.9.4/9.4.0 and solve it.

    Here's the issue on GitHub: https://github.com/npm/npm/issues/17671. Basically there's a race condition in multiple versions of npm after 5.0.3 through to 5.5.x that causes `npm install` commands to fail very, very regularly on Windows. I won't go into detail here, it's all in the issue, but it's a common issue a lot are facing.

    Downgrading to an earlier version of node+npm isn't an option for me anymore as my site has a dependency on node 8+. I could potentially set the runtime version with iisnode.yml to 8+ and use the app setting to have a node version during deployment using npm 5.0.3, but my app uses 8+ features like async/await and I'm not 100% sure that'd even build.

    Thanks!

    Ben

    Tuesday, January 23, 2018 4:32 AM

All replies

  • Note that npm 5.6.0 is already available on App Service, even if Node 8.9.3 is not. To use the newer npm, you can set WEBSITE_NPM_DEFAULT_VERSION=5.6.0 in your Azure App Settings.

    Will this achieve what you need?

    Tuesday, January 23, 2018 8:15 PM
  • Hi David,

    I'm sure it will. In all my browsing I never saw that setting. Everything seems to refer to it just using the version of npm that comes with the active version of node.

    Searching that setting exactly I see it's in the kudu GitHub wiki for .deployment configs. Ironically I was in that wiki yesterday looking for other things but never landed on that page.
    https://github.com/projectkudu/kudu/wiki/Configurable-settings 

    Might be worth having someone update the blog post I was looking at to include this app setting as a way to change the NPM version. https://blogs.msdn.microsoft.com/azureossds/2016/04/20/nodejs-and-npm-versions-on-azure-app-services/

    Thanks, I'll give this a try!

    Ben

    Wednesday, January 24, 2018 1:15 AM
  • Hi Ben,

    Indeed, that setting is poorly documented. I just emailed the blog author about adding it there.

    thanks,
    David

    Wednesday, January 24, 2018 1:30 AM