Ostkontentitan
Ostkontentitan

Reputation: 7020

node npm install -g cannot find module config-chain

I configured the node plugins on jenkins to install grunt and bower globally.

When i use it on a project npm install is executed:

 npm install -g bower@~1.2.8 grunt-cli@~0.1.11

Unfortunally it breaks immediately returning the following error:

module.js:333
    throw err;
          ^
Error: Cannot find module 'config-chain'
    at Function.Module._resolveFilename (module.js:331:15)
    at Function.Module._load (module.js:273:25)
    at Module.require (module.js:357:17)
    at require (module.js:373:17)
    at Object.<anonymous> (/Users/Shared/Jenkins/Home/tools/jenkins.plugins.nodejs.tools.NodeJSInstallation/Node_0.11.10/lib/node_modules/npm/node_modules/npmconf/npmconf.js:2:10)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:349:32)
    at Function.Module._load (module.js:305:12)
    at Module.require (module.js:357:17)

I dont think config-chain is an extra plugin necessary to be installed for it to be there.

Any ideas how to fix this?

Edit.: Fixed it thanks to the accepted answer:

npm auto-install isnt supported for mac at this time. I had to download the package manually.

Upvotes: 8

Views: 12927

Answers (4)

Pax Beach
Pax Beach

Reputation: 2813

It was the same issue. I had moved NPM prefix to 'C:\ProgramData\npm\' (you can see your prefix in 'npm config list' command).

After that I should install global packages only under the administrator credentials.

Upvotes: 0

L.Tian
L.Tian

Reputation: 63

Follow this suggest, i resolve it. "Who ever faces this problem, please do a clean install of ionic"

npm install -g ionic

If it got installed and you're still facing issues, easily install each missing module you face, globally example

npm install -g config-chain

This will re-install all missing modules, as this might have happened when you upgraded your node https://forum.ionicframework.com/t/cannot-find-module-config-chain/37130/7"

Upvotes: 2

Evan
Evan

Reputation: 7416

I encountered a different problem.

It appears as though the Jenkins NodeJS plugin was incorrectly downloading and unpacking packages from the Node.js website. When I went to go look at the unzipped folder and did an npm list, there were several packages missing.

I fixed this by telling Jenkins to download a zip file directly and unpack it.

Upvotes: 1

alex
alex

Reputation: 12275

config-chain is npm dependency, so chances are that your npm installation is broken.

Try to reinstall it, or use one of npm forks if npm itself isn't installable on your system for some reason.

Upvotes: 5

Related Questions