unable resolve npm dependencies while whitesource scan in jenkins

770 Views Asked by At

I am running jenkinsfile where we are doing whitesource scan for node_modules directory and when scanning ,in resolving dependency step its trying to connect https://registry.npmjs.org for each package and i am getting timeout error while connecting to https://registry.npmjs.org .. So the scan is going on for long time which results in Abording the job .

It was running fine in local jenkins and this problem started when we migrated the pipeline to organization managed jenkins.

console output in whitesource stage -------------------- Start: Pre-Step And Resolve Dependencies ----------

[INFO] [2022-06-28 13:49:18,694 +0530] - Trying to resolve NPM dependencies [INFO] [2022-06-28 13:49:18,697 +0530] - topFolder = /var/lib/jenkins/node/workspace/node_modules/got [ERROR] [2022-06-28 13:49:19,310 +0530] - Found error in npm ls --only=prod command [WARN] [2022-06-28 13:49:19,834 +0530] - npm ERR! missing: @sindresorhus/is@^0.14.0, required by [email protected] [WARN] [2022-06-28 13:49:19,841 +0530] - npm ERR! missing: to-readable-stream@^1.0.0, required by [email protected] [WARN] [2022-06-28 13:49:19,842 +0530] - npm ERR! missing: url-parse-lax@^3.0.0, required by [email protected] [WARN] [2022-06-28 13:49:19,844 +0530] - Failed getting dependencies after running '[npm, ls, --only=prod]', run [npm, install, --ignore-scripts] on /var/lib/jenkins/node/workspace//got folder [WARN] [2022-06-28 13:51:30,012 +0530] - Could not reach the registry using the URL: http://registry.npmjs.org/got/9.6.0. Got an error: java.net.ConnectException: Connection timed out (Connection timed out) [WARN] [2022-06-28 13:53:38,651 +0530] - Could not reach the registry using the URL: https://registry.npmjs.org/got/-/got-9.6.0.tgz. Got an error: java.net.ConnectException: Connection timed out (Connection timed out) and so on

Kindly help how to avoid this connecting to https://registry.npmjs.org ....

0

There are 0 best solutions below