After replacing Node 7.10 with 8.0.0-rc.1 I get the following stacktrace when invoking ncu:
C:\workspace\software-engineering\angular-mean>ncu
C:\Zimmermann\npm-config\node_modules\npm-check-updates\node_modules\require-dir\index.js:97
if (!require.extensions.hasOwnProperty(ext)) {
^
TypeError: require.extensions.hasOwnProperty is not a function
at requireDir (C:\Zimmermann\npm-config\node_modules\npm-check-updates\node_modules\require-dir\index.js:97:37)
at Object.<anonymous> (C:\Zimmermann\npm-config\node_modules\npm-check-updates\lib\versionmanager.js:8:23)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (C:\Zimmermann\npm-config\node_modules\npm-check-updates\lib\npm-check-updates.js:14:10)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
at Module.require (module.js:513:17)
This appears to be an issue with the require-dir module. I have created an issue and will followup accordingly. Thanks!
Also appears on my laptop. And now node 8 is not RC, it is officially released.
Expect to see the fix. Thank you.
same here
yup, still broken in Node.js 8 stable as well..
exactly
Same here as well!
Getting this issue today after a Node update
same on node8@osx
same problem after installing node 8.0
I copied the fix from the PR to require-dir https://github.com/aseemk/requireDir/pull/46/files into my global install of npm-check-updates, and it fixed the issue.
Guess we'll have to wait until the PR is merged and there's a newer version of require-dir.
same =(
+1
@jharris4 that fixed it, tnx!
Take a look at @jharris4 's pull file, simply replace the line and things will be working as intended until it's merged.
Glad it helped! Although it wasn't my PR, I just found it. :-)
Thanks, im using the require-dir PR patch now
requre-dir 0.3.2 was published with the fix. Should be fixed now without any special patches, just run npm update -g npm-check-updates. (Or maybe you have to uninstall and re-install? Not sure since ncu's version is not changing, just the underlying require-dir dependency.)
I might have recommended bumping the semver of require-dir in package.json to ^0.3.2 and tagging a new release, but heh.
@jharris4 ^0.3.1 includes 0.3.2 (semver).
@raineorshine right, but my point was that ^0.3.2 is now required for ncu to work properly with Node 8, and ^0.3.1 is not sufficient (becomes important if you're using something like yarn lock files etc)
Or maybe you have to uninstall and re-install?
Confirmed: I needed to uninstall and then re-install.
npm uninstall npm-check-updates -g && npm install npm-check-updates -g
@jharris4
right, but my point was that ^0.3.2 is now required for ncu to work properly with Node 8, and ^0.3.1 is not sufficient (becomes important if you're using something like yarn lock files etc)
Ah, you are right!
I think patches in general can be assumed to fix bugs within the same major/minor version. If you lock your dependencies and do not allow patch upgrades, you miss out on bug fixes.
@mathiasbynens Just FYI, with npm 5.0.0 (which I just upgraded to) there are some problems uninstalling global packages. I had to re-install without uninstalling, but it worked.
Here's a link to the issue on npm: https://github.com/npm/npm/issues/16738
npm uninstall npm-check-updates -g && npm install npm-check-updates -g works.
@webjay Are you using npm 5.0.0 with npm-check-updates previously installed with npm 4.x?
@jharris4 I'm using npm 4.2.0 and node v8 on a Mac.
@webjay I guessed as much. I'm using homebrew to install node on a Mac too :-)
@webjay Thank you! It works.
I'm on OS X with Node installed by brew and npm installed separately. The uninstall also didn't work but npm install npm-check-updates -g alone seems to have fixed things up.
El Capitan 10.11.6 / homebrew upgrade node v8.1.2 / npm v5.0.3
the attempt for npm uninstall npm-check-updates -g && npm install npm-check-updates -g or soleley npm install npm-check-updates -g as mentioned in a previous homebrew user comment, fails with:
`Unhandled rejection Error: Argument #2: Expected string but got nullf8dfac7a8f7b
at addDependency (/usr/local/lib/node_modules/npm/lib/install/deps.js:515:3)
at /usr/local/lib/node_modules/npm/lib/install/deps.js:463:5
at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:35
at Array.forEach (native)
at /usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:52:11
at Array.forEach (native)
at asyncMap (/usr/local/lib/node_modules/npm/node_modules/slide/lib/async-map.js:51:8)
at loadDeps (/usr/local/lib/node_modules/npm/lib/install/deps.js:455:3)
at Array.
at LOOP (/usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
at /usr/local/lib/node_modules/npm/node_modules/slide/lib/chain.js:18:7
at /usr/local/lib/node_modules/npm/lib/install/and-finish-tracker.js:8:8
at resolveBranchDeps.then (/usr/local/lib/node_modules/npm/lib/install/deps.js:419:11)
at tryCatcher (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:512:31)
at Promise._settlePromise (/usr/local/lib/node_modules/npm/node_modules/bluebird/js/release/promise.js:569:18)
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! https://github.com/npm/npm/issues
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Helder/.npm/_logs/2017-06-22T09_24_53_902Z-debug.log`
After removing the project node_modules and running npm install after the ncu uninstall and install process seems to fix the issue on this side.
sudo apt-get remove nodejs
sudo apt-get remove npm
Then go to /etc/apt/sources.list.d and remove any node list if you have. Then do a
sudo apt-get update
Check for any .npm or .node folder in your home folder and delete those.
If you type
which node
you can see the location of the node. Try which nodejs and which npm too
Now install node.js
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
I was able to resolve this quick because I have NVM installed. I just switched to a different version of Node.
_*just make sure your project doesn't require that specific version of node._
I was using node -v = v8.7.0
switched to v6.2.2
Most helpful comment
yup, still broken in Node.js 8 stable as well..