2

I used following in package.json when deploying to azure web site:

{
    "name": "mypackage",
    ...
    "engines": {
        "node": "6.11.1",
        "npm": "4.2.0"
    },
    ...
}

Everything worked fine but I also got following warning:

npm WARN lifecycle The node binary used for scripts is D:\Program Files (x86)\nodejs\6.9.1\node.exe but npm is using D:\Program Files (x86)\nodejs\6.11.1\node.exe itself. Use the --scripts-prepend-node-path option to include the path for the node binary npm was executed with. Finished successfully.

How do I set this --scripts-prepend-node-path option when deploying to azure web sites?

2 Answers 2

5

You can set this option by using npm config set scripts-prepend-node-path true when deploying to Azure.

0
3

In your Azure App settings, try setting WEBSITE_NODE_DEFAULT_VERSION to 6.11.1 so it matches your engine spec. Though I'm guessing the warning is mostly harmless.

Though the above should solve your issue, to more directly answer your question, you can add npm params by creating a Custom Deployment Script. Specifically, you'd look for a line that looks like call :ExecuteCmd !NPM_CMD! install --production and modify it whichever way you need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.