Npm-check-updates: Cannot find module 'config-chain'

Created on 19 Nov 2015  Â·  24Comments  Â·  Source: raineorshine/npm-check-updates

$ node -v
v0.12.7
$ npm -v
3.4.1
$ ncu -g
module.js:338
throw err;
^
Error: Cannot find module 'config-chain'
at Function.Module._resolveFilename (module.js:336:15)
at Function.Module._load (module.js:278:25)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at Object. (/Users/pinal.bhatt/.npm-packages/lib/node_modules/npm-check-updates/node_modules/npmi/node_modules/npm/lib/config/core.js:2:10)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Module.require (module.js:365:17)
at require (module.js:384:17)
at /Users/pinal.bhatt/.npm-packages/lib/node_modules/npm-check-updates/node_modules/npmi/node_modules/npm/lib/npm.js:16:15
at Object. (/Users/pinal.bhatt/.npm-packages/lib/node_modules/npm-check-updates/node_modules/npmi/node_modules/npm/lib/npm.js:469:3)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)

bug

Most helpful comment

Ran into the same issue on

node v5.1.0 and npm v3.3.12

doing a uninstall and re-install fixed it for me...

sudo npm uninstall -g npm-check-updates && sudo npm install -g npm-check-updates

All 24 comments

Can confirm, I get the same error on node 5.0.0

Can confirm, I get the same error on node 5.1.0

Same here.

Workaround:

npm install -g config-chain
npm install -g nopt
npm install -g umask
npm install -g npm-registry-client

This workaround does not works. Rather is asking for many more
dependencies. Don't know why but now even "npm list -g" command is also
giveing lot many errors for missing packages.

npm ERR! missing: npmlog@, required by [email protected]
npm ERR! missing: npmlog@, required by [email protected]
npm ERR! missing: ansi-regex@^2.0.0, required by [email protected]
npm ERR! missing: after-all@^2.0.1, required by [email protected]
npm ERR! missing: console-log-level@^1.0.0, required by [email protected]
npm ERR! missing: json-stringify-safe@^5.0.0, required by [email protected]
npm ERR! missing: stackman@^0.2.2, required by [email protected]
npm ERR! missing: throttleit@~0.0.2, required by [email protected]
npm ERR! missing: npmlog@, required by [email protected]
npm ERR! missing: [email protected], required by [email protected]
npm ERR! extraneous: [email protected]
/Users/pinal.bhatt/.npm-packages/lib/node_modules/node-gyp/node_modules/array-index
npm ERR! extraneous: [email protected]
/Users/pinal.bhatt/.npm-packages/lib/node_modules/node-gyp/node_modules/aws-sign2
npm ERR! extraneous: [email protected]
/Users/pinal.bhatt/.npm-packages/lib/node_modules/node-gyp/node_modules/balanced-match
npm ERR! extraneous: [email protected]
/Users/pinal.bhatt/.npm-packages/lib/node_modules/node-gyp/node_modules/pinkie-promise
npm ERR! extraneous: [email protected]
/Users/pinal.bhatt/.npm-packages/lib/node_modules/node-gyp/node_modules/qs
npm ERR! extraneous: [email protected]
/Users/pinal.bhatt/.npm-packages/lib/node_modules/node-gyp/node_modules/util-deprecate
npm ERR! extraneous: [email protected]
/Users/pinal.bhatt/.npm-packages/lib/node_modules/node-gyp/node_modules/xtend
npm ERR! missing: brace-expansion@^1.0.0, required by [email protected]
npm ERR! error in
/Users/pinal.bhatt/.npm-packages/lib/node_modules/node-gyp/node_modules/path-array/node_modules/array-index:
ENOENT, open
'/Users/pinal.bhatt/.npm-packages/lib/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json'
npm ERR! invalid: array-index
/Users/pinal.bhatt/.npm-packages/lib/node_modules/node-gyp/node_modules/path-array/node_modules/array-index
npm ERR! missing: qs@~5.1.0, required by [email protected]
npm ERR! missing: hawk@~3.1.0, required by [email protected]
npm ERR! missing: aws-sign2@~0.5.0, required by [email protected]
npm ERR! missing: har-validator@^1.6.1, required by [email protected]
npm ERR! missing: readable-stream@~2.0.0, required by [email protected]
npm ERR! missing: minimatch@^2.0.1, required by [email protected]
npm ERR! missing: npmlog@, required by [email protected]

On Fri, Nov 20, 2015 at 3:14 PM, Elad Ossadon [email protected]
wrote:

Workaround:

npm install -g config-chain
npm install -g nopt
npm install -g umask
npm install -g npm-registry-client

—
Reply to this email directly or view it on GitHub
https://github.com/tjunnone/npm-check-updates/issues/173#issuecomment-158512881
.

[image: PBDesk.IO] http://PBDesk.io
PBDesk.IO

Can confirm, I get the same error on node 5.1.0 and 5.0.0

I'm getting the same on Node.js 5.1.0. @elado's workaround worked for me, thanks!
@pinalbhatt, I think you're having an (additional) unrelated issue with npm there.

Getting this on node 4.2.2 LTS. @elado's workaround helped.

Different npm versions are causing all kinds of havoc these days. Sorry we can't seem to pin it down.

I also hit this bug. At first I tried reinstalling every module it reported missing, but eventually gave up (too many!). Then I updated npm to the latest version, uninstalled and reinstalled this module. That fixed the issue at my end.

I also hit this bug with node v5.1.0 and npm v3.3.12, module remove + install fixed it for me. No update of npm was required.

I encountered this bug in v2.5.1 but it seems to be fixed since v2.5.3

Node v5.3.0 + npm v3.3.12 + ncu v2.5.5
Reinstall fix this problem.

npm uninstall -g npm-check-updates && npm install -g npm-check-updates

Node v5.3.0 + npm v3.5.2 + ncu v2.5.6

Reinstalling doesn't solve the issue.

@ignlg Thanks for reporting. I haven't been able to reproduce the issue so it is has been difficult to know if it exists in ncu or if it exists as an environment issue with npm versions or something.

I have the same problem with:
node - 5.4.1 and npm - 3.5.4
And solution for me was to replace npm bundled to npmi.
Like this:

rm -rf /usr/local/lib/node_modules/npm-check-updates/node_modules/npmi/node_modules/npm
cp -R /usr/local/lib/node_modules/npm /usr/local/lib/node_modules/npm-check-updates/node_modules/npmi/node_modules/npm

I'm on npm v3.3.12 + node v5.4.0 and uninstalling and re-installing ncu after installing the dependencies @elado mentioned fixed it for me.

I encountered this bug with v2.5.6, but v2.5.5 worked. Here is the workaround:

npm uninstall -g npm-check-updates && npm install -g [email protected]

@m157y That might be the key. Somehow npmi's version of npm is being used instead of the system version. I would like to rip out npmi completely to avoid this issue but then we need a replacement solution for dynamically installing bower. We should probably spawn the system version of node to begin with instead of including it as a dependency to ensure that there is no conflict with the user's installed npm (which seems to be the direction that npmi is going anyway).

I got started on it this morning but got hung up on an issue with getting a correct npm ls -g output on my machine, which has slowed me down.

I just hit this when upgrading to ncu 2.5.7 (latest) on node 5.4.1, npm 3.3.12. Fixed by doing an uninstall/install of ncu latest.

I have it running again after upgrading to:
node v5.5.0 (from v5.3.0), npm 3.5.3 (from 3.5.2), ncu 2.5.7 (from 2.5.6)

Ran into the same issue on

node v5.1.0 and npm v3.3.12

doing a uninstall and re-install fixed it for me...

sudo npm uninstall -g npm-check-updates && sudo npm install -g npm-check-updates

Uninstalling and reinstalling didn't work for me, neither did clearing the cache. However, doing an npm install in he following directory fixed this for me:
"[global-npm-modules-location]/npm-check-updates/node_modules/npm"

This ensured that config-chain was installed and accessible by the the npm/lib/config/core.js file.

Below is the error which I received, for those that may find this useful.

$ ncu
module.js:442
    throw err;
    ^

Error: Cannot find module 'config-chain'
    at Function.Module._resolveFilename (module.js:440:15)
    at Function.Module._load (module.js:388:25)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\Users\bass-\AppData\Roaming\npm\node_modules\npm-c                                    heck-updates\node_modules\npm\lib\config\core.js:1:72)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at C:\Users\bass-\AppData\Roaming\npm\node_modules\npm-check-updates\node_mo                                    dules\npm\lib\npm.js:22:17
    at Object.<anonymous> (C:\Users\bass-\AppData\Roaming\npm\node_modules\npm-c                                    heck-updates\node_modules\npm\lib\npm.js:394:3)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)

ENV: Windows 10 64-bit, Node.JS v6.3.1, NPM v3.10.5, npm-check-updates v2.7.2

ncu now requires node >= 8

Was this page helpful?
0 / 5 - 0 ratings