I've a frustrating issue when "npm install" is executed inside a Jenkins Groovy pipeline using the NodeJS plugin, the process hangs with the following error -
npm install --ddd ng-cli
npm info it worked if it ends with ok
npm verb cli [ '/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs893-v2/bin/node',
npm verb cli '/var/jenkins_home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodejs893-v2/bin/npm',
npm verb cli 'install',
npm verb cli '--ddd',
npm verb cli 'ng-cli' ]
npm info using npm@5.5.1
npm info using node@v8.9.3
npm verb npm-session e522ad0a36f1c038
npm sill install loadCurrentTree
npm sill install readLocalPackageData
npm http fetch GET 503 https://registry.npmjs.org/ng-cli 70252ms attempt #3
npm sill fetchPackageMetaData error for ng-cli@latest 503 Service Unavailable: ng-cli@latest
npm verb stack Error: 503 Service Unavailable: ng-cli@latest
When the command is executed directly on the EC2, the package installs without issue as the Jenkins user.
Also when the command is executed inside the Jenkins Docker, the package installs without issue as the Jenkins user using the same Node installation.
The Docker instance is not limited by CPU or RAM.
The setup is Jenkins v2.138.1 running inside a Docker container, which in turn is hosted on an EC2 v2018.03. Jenkins home is mounted as an EFS volume. The JVM is running on Java v1.8.0_181. NPM is v5.1.1.
Any pointers would be much appreciated.
Reply to first suggestion
Yes there is direct internet connectivity, without any proxy. If a single package is installed such as
npm install ng-cli
The npm install works without issue.