Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Selected npm version null" or similar during node deployment #30

Open
nickwalkmsft opened this issue Jun 7, 2017 · 2 comments
Open

Comments

@nickwalkmsft
Copy link
Contributor

Kudu's selectNodeVersion.js doesn't correctly handle values of WEBSITE_NODE_DEFAULT_VERSION calculated from linuxFxVersion.

A fix will be rolled out soon. In the meantime (and generally), the recommendation to customers is to set engines.node in package.json to a major.minor version. This will ensure usage of the newest point release of the desired major.minor.

@prashanthmadi
Copy link

prashanthmadi commented May 21, 2018

@nickwalkmsft

  • Changing nodejs version with engines in package.json or WEBSITE_NODE_DEFAULT_VERSION would change nodejs version during git deployment.

unfortunately, selecting nodejs version during git deployment from package.json doesn't work as expected.. so i came up with below script..
https://github.com/prashanthmadi/ng-azure-webapp-linux/blob/master/deploy.sh

  • kudu cli would still stay at node v6.11.0 after above changes
  • To change nodejs version in app container, we need to use dropdown available in portal

Important thing here is the second point.. there is no way to change nodejs version in kudu cli and this would cause some issues as below..

Try deploying below app as part of github deployment
https://github.com/prashanthmadi/ng-azure-webapp-linux

and you might experience below error..

You are running version v6.11.0 of Node.js, which is not supported by Angular CLI v6.
The official Node.js version that is supported is 8.9 and greater.
An error has occurred during web site deployment.

react build failed
Please visit https://nodejs.org/en/ to find instructions on how to update Node.js.
npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! lptest-angular@0.0.0 build: `ng build`
npm ERR! Exit status 3
npm ERR! 
npm ERR! Failed at the lptest-angular@0.0.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/.npm/_logs/2018-05-18T17_21_17_609Z-debug.log
npm WARN notice [SECURITY] ws has 1 high vulnerability. Go here for more details: https://nodesecurity.io/advisories?search=ws&version=1.1.2 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.\nnpm WARN notice [SECURITY] stringstream has 1 moderate vulnerability. Go here for more details: https://nodesecurity.io/advisories?search=stringstream&version=0.0.6 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.\nnpm WARN notice [SECURITY] debug has 1 low vulnerability. Go here for more details: https://nodesecurity.io/advisories?search=debug&version=2.3.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.\nnpm WARN notice [SECURITY] debug has 1 low vulnerability. Go here for more details: https://nodesecurity.io/advisories?search=debug&version=2.2.0 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.\nnpm WARN notice [SECURITY] parsejson has 1 high vulnerability. Go here for more details: https://nodesecurity.io/advisories?search=parsejson&version=0.0.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.\nnpm WARN notice [SECURITY] tunnel-agent has 1 moderate vulnerability. Go here for more details: https://nodesecurity.io/advisories?search=tunnel-agent&version=0.4.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.\nnpm WARN notice [SECURITY] hoek has 1 moderate vulnerability. Go here for more details: https://nodesecurity.io/advisories?search=hoek&version=2.16.3 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.\nnpm WARN notice [SECURITY] lodash has 1 low vulnerability. Go here for more details: https://nodesecurity.io/advisories?search=lodash&version=3.10.1 - Run `npm i npm@latest -g` to upgrade your npm version, and then `npm audit` to get more info.\nnpm WARN prefer global node-gyp@3.6.2 should be installed with -g\nYou are running version v6.11.0 of Node.js, which is not supported by Angular CLI v6.\nThe official Node.js version that is supported is 8.9 and greater.\n\nPlease visit https://nodejs.org/en/ to find instructions on how to update Node.js.\nnpm ERR! code ELIFECYCLE\nnpm ERR! errno 3\nnpm ERR! lptest-angular@0.0.0 build: `ng build`\nnpm ERR! Exit status 3\nnpm ERR! \nnpm ERR! Failed at the lptest-angular@0.0.0 build script.\nnpm ERR! This is probably not a problem with npm. There is likely additional logging output above.\n\nnpm ERR! A complete log of this run can be found in:\nnpm ERR!     /home/.npm/_logs/2018-05-18T17_21_17_609Z-debug.log\n/opt/Kudu/bin/Scripts/starter.sh bash deploy.sh

we need to make this line configurable via APP setting or set it to higher version > 9
https://github.com/Azure-App-Service/kudu/blob/master/kudu/Dockerfile#L161

ENV PATH $PATH:/opt/nodejs/6.11.0/bin

@prashanthmadi
Copy link

prashanthmadi commented May 21, 2018

I have tried setting PATH manually from cli but unable to change it.. could be that we don't allow changing it..

/opt/nodejs>echo $PATH
/home/site/deployments/tools:/opt/Kudu/bin/Scripts:/usr/bin:/usr/bin:::Microsoft SDKs/F#/3.1/Framework/v4.0:/usr/bin:/usr/share/npm:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/local/go/bin:/usr/local/.rbenv/bin:/usr/local:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/nodejs/6.11.0/bin

/opt/nodejs>set PATH=$PATH:/opt/nodejs/9.4.0/bin

/opt/nodejs>echo $PATH
/home/site/deployments/tools:/opt/Kudu/bin/Scripts:/usr/bin:/usr/bin:::Microsoft SDKs/F#/3.1/Framework/v4.0:/usr/bin:/usr/share/npm:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/local/bin:/usr/local/go/bin:/usr/local/.rbenv/bin:/usr/local:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/nodejs/6.11.0/bin

/opt/nodejs>node -v
v6.11.0

Update: setting it from script might work.. will work on it and update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants