Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Npm install not working via Jenkins - cb() never called 2018 #21174

Open
1 task done
NxRoot opened this issue Jul 9, 2018 · 16 comments
Open
1 task done

Npm install not working via Jenkins - cb() never called 2018 #21174

NxRoot opened this issue Jul 9, 2018 · 16 comments
Labels

Comments

@NxRoot
Copy link

NxRoot commented Jul 9, 2018

I'm opening this issue because:

  • npm is producing incorrect or undesirable behavior.

What's going wrong?

THIS ONLY PRODUCES AN ERROR VIA JENKINS (I NEED A FIX)

npm install working on root folder but not on jenkins.
if i delete node_modules and package-lock.json and try to run npm install command manually in the project folder it works with no problem, but im trying to make it automatic through jenkins and it doesnt seem to be working if i try the same thing.
WHY? PLEASE HELP!

Jenkins Shell Script:

#!/bin/sh
node --version
npm --version
npm get registry
echo
echo "Installing Node Modules"
npm install --verbose

Jenkins Output:

v10.6.0
6.1.0
https://registry.npmjs.org

Installing Node Modules
npm info it worked if it ends with ok
npm verb cli [ '/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/oldNode/bin/node',
npm verb cli   '/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/bin/npm',
npm verb cli   'install',
npm verb cli   '--verbose',
npm verb cli   '/var/lib/jenkins/workspace/ClinicSite/default' ]
npm info using npm@6.1.0
npm info using node@v9.2.0
npm verb npm-session 1d6cc049a7891acf
npm info lifecycle clinic-site@0.0.0~preinstall: clinic-site@0.0.0
npm timing stage:loadCurrentTree Completed in 69ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 1ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 2196ms
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 4369ms
npm timing stage:loadIdealTree Completed in 7951ms
npm timing stage:generateActionsToTake Completed in 2516ms
npm verb correctMkdir /var/lib/jenkins/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /var/lib/jenkins/.npm/_locks/staging-9d6307feb590e326.lock for /var/lib/jenkins/workspace/ClinicSite/default/node_modules/.staging
npm timing audit compress Completed in 39ms
npm info audit Submitting payload of 68494bytes
npm timing audit submit Completed in 20722ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 20350ms
npm timing audit body Completed in 2ms
Unhandled rejection Error: invalid config key requested: single
    at pudGet (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/figgy-pudding/index.js:31:11)
    at FiggyPudding.get (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/figgy-pudding/index.js:13:12)
    at Object.get (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/figgy-pudding/index.js:71:16)
    at _parse (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/ssri/index.js:138:12)
    at parse (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/ssri/index.js:125:12)
    at Object.checkData (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/ssri/index.js:216:9)
    at write (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/cacache/lib/content/write.js:34:31)
    at putData (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/cacache/put.js:25:10)
    at Object.x.put (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/cacache/locales/en.js:28:37)
    at readFileAsync.then.data (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/pacote/lib/fetchers/file.js:38:28)
    at tryCatcher (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:693:18)
    at Promise._fulfill (/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/nodeInstall/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:638:18)
npm timing npm Completed in 140915ms
npm ERR! cb() never called!
@NxRoot
Copy link
Author

NxRoot commented Jul 9, 2018

Downgraded NPM to v5.5.1, now it's working nice to know Npm leaves a bug for a few years and dont care

@kenany kenany added the support label Jul 9, 2018
@DanielRuf
Copy link

Does 5.7.1 also work or just 5.5.1?
Would be helpful to now in which release it was introduced.

@NxRoot
Copy link
Author

NxRoot commented Jul 9, 2018

Ive seen this issue all over the internet nowadays the only fix seems to be downgrading. I believe this bug is related to npm paths misconfigurations.
Didn't test any other version, but im pretty sure any version below 6.x.x should work.

Notes:
JENKINS WILL NOT USE THE DEFAULT NPM FROM NODEJS JENKINS PLUGIN AUTOMATIC INSTALLATION! IF YOU HAVE ANY OTHER NPM VERSION INSTALLED MANUALLY IT WILL USE THAT ONE.
Specify the path if you want to use the default one.
Ex:
/var/lib/jenkins/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/myNode/npm install

@DanielRuf
Copy link

invalid config key requested: single

This is the issue in your case, the error message at the end is very general.

@NxRoot
Copy link
Author

NxRoot commented Jul 9, 2018

Thats also a generic response error, its not in my case specific, everything i have configured is default the error shouldnt show up at all, if you search this npm issue in this github it has been a known bug for a few years, its a fresh and clean jenkins installation and its using default NodeJs and Npm that comes with it, so it cant be my case specific thats for sure.

@DanielRuf
Copy link

This one comes from figgy-pudding unlike the others.

@NxRoot
Copy link
Author

NxRoot commented Jul 9, 2018

Bro, i dont even know what figgy-pudding is, that camed with NPM itself by default, THIS IS NOT A SPECIFIC ERROR! so stop saying its figgy-pudding please, im trying to help, ur only messing peoples head, UR NOT HELPING! If you dont know what ur saying please dont comment about it, thats bad information, thank you

@DanielRuf
Copy link

Please see #21095 and other older issues, the error message is very general, the exact error is still Unhandled rejection Error: invalid config key requested: single.

@DanielRuf
Copy link

Any exception does immediately return and break the further execution and so the callback cb is never called (timeout).

@DanielRuf
Copy link

Please change your title to something like Unhandled rejection Error: invalid config key requested: single.

@NxRoot
Copy link
Author

NxRoot commented Jul 9, 2018

Thats why im saying IT IS NOT IN MY CASE SPECIFIC! I DID NOT INSTALLED FIGGY-PUDDING I DONT KNOW WHAT THAT IS BUT IT IS NOT ONE OF MY DEPENDENCIES, IT CAMED WITH NPM INSIDE JENKINS FRESH INSTALL, SO IF YOU WISH TO KEEP SAYING THAT JUST INSTALL JENKINS AND NODEJS PLUGIN AND TRY IT FOR YOURSELF, nothing else to say if u cant help, thank you

@DanielRuf
Copy link

IT IS NOT IN MY CASE SPECIFIC

It is =)

@DanielRuf
Copy link

I DID NOT INSTALLED FIGGY-PUDDING

I just meant that the bug is probably in there, it is part of npm.
Still, the error which causes this is totally different than the others =)

@NxRoot
Copy link
Author

NxRoot commented Jul 9, 2018

Bro ur just retarded, i didnt ask for figgy-pudding to be installed, if it is there it shouldnt be, so its general because i didnt installed anything else and it should not happen, so its not a specific thing that i have done, every jenkins instalation with npm breaks the same way, so its not specific, if it was downgrading wouldnt help, get smart bro

@DanielRuf
Copy link

It is part of npm. I just noticed that there might be the issue / bug.
https://github.com/zkat/figgy-pudding

The error message is still specific as the other issues with the same cb error do not point to figgy-pudding but other causes.

I just try to get down to the rootcause and share the findings.
Everything is ok =)

@DanielRuf
Copy link

Also it is good to know which release of npm introduced this bug / issue to pinpoint the problematic files (do some diffs and bisecting).

I hope this is understandable.

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

No branches or pull requests

3 participants