raineorshine / npm-check-updates

Find newer versions of package dependencies than what your package.json allows
Other
9.4k stars 326 forks source link

ncu -g doesn't work on homebrew or windows #146

Closed cebor closed 8 years ago

cebor commented 9 years ago

ncu -g always says that my deps are up to date, even when they are not!

node: 4.1.1 (brew) os: osx 10.11

$ ncu -g

All global packages are up-to-date :)

On my ubuntu machine all works fine!

raineorshine commented 9 years ago

Thanks for reporting. Will you post your global packages? (npm -g ls --depth=0)

cebor commented 9 years ago
➜  ~  npm -g ls --depth=0
/usr/local/lib
├── bower@1.5.3
├── generator-angular@0.12.1
├── generator-gulp@0.2.0
├── generator-karma@1.0.0
├── grunt-cli@0.1.13
├── npm@2.14.8
├── npm-check-updates@2.3.0
├── strongloop@5.0.1
└── yo@1.4.8
 ➜  ~  ncu -g

All global packages are up-to-date :)
ghost commented 9 years ago

I have the same problem.

osahner commented 9 years ago

same here.

npm -g list --dept=0
/usr/local/lib
...
├── clean-css@3.4.5
...
├── npm@3.3.9
├── npm-check-updates@2.3.3
...
npm show clean-css version
3.4.6
ncu -g

All global packages are up-to-date :)
uname -a
Darwin ***.local 15.0.0 Darwin Kernel Version 15.0.0: Sat Sep 19 15:53:46 PDT 2015; root:xnu-3247.10.11~1/RELEASE_X86_64 x86_64

brew --version
0.9.5 (git revision 91b03; last commit 2015-10-21)
raineorshine commented 9 years ago

Unfortunately I cannot reproduce on my machine:

$ ncu -g

 clean-css   3.4.5  →   3.4.6 
 npm        2.14.4  →   3.3.9 

$ uname -a
Darwin ***.local 13.1.0 Darwin Kernel Version 13.1.0: Wed Apr  2 23:52:02 PDT 2014; root:xnu-2422.92.1~2/RELEASE_X86_64 x86_64
cebor commented 9 years ago

i have this problem, since upgraded to node 4.2 from 0.12.

obsoke commented 9 years ago

Similar issues here:

$ npm -g ls --depth=0
/usr/local/lib
├── babel@5.8.23
├── bower@1.5.3
├── browserify@11.2.0
├── eslint@1.6.0
├── eslint-plugin-babel@2.1.1
├── eslint-plugin-react@3.5.1
├── gulp@3.9.0
├── node-inspector@0.12.3
├── npm@2.14.7
├── npm-check-updates@2.3.4
├── tern@0.15.0
├── watchify@3.4.0
├── webpack@1.12.2
└── webpack-dev-server@1.12.1

Babel is out of date when I check NPM manually:

$ npm info babel | grep version
  versions:
  version: '5.8.29',
$ ncu -g

All global packages are up-to-date :)
cebor commented 8 years ago

Any updates?

➜  ~  npm install -g less@1.0.5
/usr/local/lib
└── less@1.0.5

 ➜  ~  ncu -g --loglevel verbose
Initializing...
Running in global mode...
Getting installed packages...
Fetching latest versions...

All global packages are up-to-date :)

Is there anything i can do to debug this ?

deepfriedmind commented 8 years ago

Check this issue from npm-check which is a similar module: https://github.com/dylang/npm-check/issues/53

cebor commented 8 years ago

@deepfriedmind nice

this works :)

$ PREFIX="/usr/local/" ncu -g

 less  1.0.5  →  2.5.3
raineorshine commented 8 years ago

@deepfriedmind Good catch! Thanks!

I will keep an eye on the aforementioned issues. When they are resolved I will incorporate their fix.

raineorshine commented 8 years ago

@cebor Can you confirm that you have node installed via brew?

cebor commented 8 years ago

@metaraine

$ which node
/usr/local/bin/node

$ brew info node
node: stable 5.0.0 (bottled), HEAD
Platform built on the V8 JavaScript runtime to build network applications
https://nodejs.org/
/usr/local/Cellar/node/5.0.0 (2824 files, 36M) *
  Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/node.rb
G3z commented 8 years ago

+1

glen-84 commented 8 years ago

I'm on Windows 10 (Node v5.1.0, NPM v3.5.1).

$ ncu -g
Warning: .settle() is deprecated and will be removed in a future version. Use .reflect() instead.
    at Object.getLatestVersions (C:\Users\Glen\AppData\Roaming\npm\node_modules\npm-check-updates\lib\versionmanager.js:306:20)
    at upgradePackageDefinitions (C:\Users\Glen\AppData\Roaming\npm\node_modules\npm-check-updates\lib\npm-check-updates.js:107:15)
    at C:\Users\Glen\AppData\Roaming\npm\node_modules\npm-check-updates\lib\npm-check-updates.js:125:20
    at processImmediate [as _immediateCallback] (timers.js:383:17)
From previous event:
    at analyzeGlobalPackages (C:\Users\Glen\AppData\Roaming\npm\node_modules\npm-check-updates\lib\npm-check-updates.js:123:10)
    at programRunGlobal (C:\Users\Glen\AppData\Roaming\npm\node_modules\npm-check-updates\lib\npm-check-updates.js:331:12)
    at programRun (C:\Users\Glen\AppData\Roaming\npm\node_modules\npm-check-updates\lib\npm-check-updates.js:322:29)
    at doNTCallback0 (node.js:430:9)
    at process._tickCallback (node.js:359:13)
From previous event:
    at Object.module.exports._.merge.run (C:\Users\Glen\AppData\Roaming\npm\node_modules\npm-check-updates\lib\npm-check-updates.js:403:12)
    at Object.<anonymous> (C:\Users\Glen\AppData\Roaming\npm\node_modules\npm-check-updates\bin\npm-check-updates:38:5)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Function.Module.runMain (module.js:457:10)
    at startup (node.js:138:18)
    at node.js:974:3

All global packages are up-to-date :)
$ npm outdated -g
Package     Current  Wanted  Latest  Location
gulp-cli      0.4.0     git     git
tslint        3.0.0   3.1.1   3.1.1
typescript    1.6.2   1.7.3   1.7.3
raineorshine commented 8 years ago

@glen-84 I added some more logging in v2.5.2. Will you npm install -g npm-check-updates@latest and post the output from ncu -g --loglevel silly?

glen-84 commented 8 years ago

@metaraine I've already updated the dependencies (except for gulp-cli, but that's Git which I don't think that NCU lists anyway).

I assume that you want to see the output while there is an expected update?

raineorshine commented 8 years ago

Yes, that would be helpful if you're able.

npm -g install tslint@3.0.0 # downgrade
ncu -g --loglevel silly
glen-84 commented 8 years ago
$ ncu -g --loglevel silly
Initializing...
Running in global mode...
Getting installed packages...
{ npm: '3.5.1' }

Fetching latest versions...
{ npm: '3.5.0' }

All global packages are up-to-date :)

Seems like it's not looking in the right place?

raineorshine commented 8 years ago

Apparently not. When you run ncu in global mode, npm is initialized with global: true, which on my machine (OSX) makes it check the globally installed dependencies. I wonder if using npm programmatically on Windows does not give the correct behavior. I could try spawning npm from the shell instead of using npm programmatically when running the list command to get the installed dependencies.

glen-84 commented 8 years ago

But there are other users using OSX above?

raineorshine commented 8 years ago

@glen-84 It was a homebrew issue for them (comment-155758303). Maybe it's a separate issue for Windows users.

ntwb commented 8 years ago

A slight variation:

$ ncu -g --loglevel silly
Initializing...
Running in global mode...
Getting installed packages...
{}

Fetching latest versions...
{}

All global packages are up-to-date :)

And my global packages if this is helpful: (Using Node v5.1.0)

$ npm list -g --depth=0
/usr/local/lib
├── bower@1.5.2
├── csslint@0.10.0
├── cssstats@2.1.2
├── doiuse@2.2.0
├── eslint@1.5.0
├── grizzly@1.0.14
├── grunt@0.4.5
├── grunt-cli@0.1.13
├── impromptu@0.2.6
├── jscs@2.1.1
├── jshint@2.8.0
├── npm@3.3.12
├── npm-check-updates@2.5.2
├── pageres-cli@1.1.1
├── postcss@5.0.12
├── postcss-cli@2.0.0
├── postcss-reporter@1.1.0
├── pretty-diff@0.3.1
├── stylehacks@2.2.0
├── stylelint@2.3.5
├── svg2png-command@1.0.2
└── xo@0.11.2

I've now manually updated all the packages using npm update -g package:

$ npm list -g --depth=0
/usr/local/lib
├── bower@1.6.8
├── csslint@0.10.0
├── cssstats@2.1.2
├── doiuse@2.2.0
├── eslint@1.10.3
├── grizzly@1.0.15
├── grunt@0.4.5
├── grunt-cli@0.1.13
├── impromptu@0.2.6
├── jscs@2.6.0
├── jshint@2.8.0
├── npm@3.3.12
├── npm-check-updates@2.5.2
├── postcss@5.0.12
├── postcss-cli@2.3.2
├── postcss-reporter@1.3.0
├── pretty-diff@0.4.1
├── stylehacks@2.2.0
├── stylelint@2.3.5
├── svg2png-command@1.0.2
└── xo@0.11.2
raineorshine commented 8 years ago

@ntwb Thanks Stephen. This makes it pretty clear that npm.list is not working in global mode in some situations. How do you have node installed? Are you using Homebrew, nvm, Windows, ...?

ntwb commented 8 years ago

How do you have node installed?

Using Homebrew and El Capitan:

$ which npm
/usr/local/bin/npm

$ which node
/usr/local/bin/node

$ which ncu
/usr/local/bin/ncu

$ which npm-check-updates 
/usr/local/bin/npm-check-updates

p.s. I can also install and test any of this on Windows if/when needed, I use Scoop (Homebrew for Windows) http://scoop.sh/

deepfriedmind commented 8 years ago

I had Node installed via Homebrew. After installing it with nvm instead, everything is working fine.

glen-84 commented 8 years ago

Now even ncu --upgradeAll isn't working ...

$ ncu --upgradeAll

The following dependency is satisfied by its declared version range, but the installed version is behind. You can install the latest version without modifying your package file by using npm update. If you want to update the dependency in your package file anyway, use --upgradeAll.

 gulp-typescript  ^2.9.2  →  ^2.10.0

Edit: I see there is already an issue for this (https://github.com/tjunnone/npm-check-updates/issues/182).

raineorshine commented 8 years ago

@ntwb Try cebor's suggestion (also documented in Known Issues).

raineorshine commented 8 years ago

@glen-84 (or another Windows user): What do you get from the following commands?

$ which npm-check-updates
/Users/raine/.nvm/versions/node/v4.2.1/bin/ncu

$ npm -g prefix
/Users/raine/.nvm/versions/node/v4.2.1

And if you're still feeling helpful:

$ mkdir node_modules
$ npm install global-prefix
$ node -e "console.log(require('global-prefix'))"
/Users/raine/.nvm/versions/node/v4.2.1
glen-84 commented 8 years ago
$ which npm-check-updates
/c/Users/Glen/AppData/Roaming/npm/npm-check-updates

$ npm -g prefix
C:\Users\Glen\AppData\Roaming\npm

$ node -e "console.log(require('global-prefix'))"
C:\Program Files\nodejs
ntwb commented 8 years ago

Here's my not so up to date Windows info: (Which npm-check-updates -g works as expected :wink: )

$ npm-check-updates -g

"npm" can be updated from 2.7.5 to 3.5.1
"npm-check-updates" can be updated from 1.5.1 to 2.5.2

Old version details:

$ npm-check-updates --version
1.5.1

$ which npm-check-updates
C:\Users\Stephen\AppData\Local\scoop\apps\nodejs\0.12.1\nodejs\npm-check-updates
C:\Users\Stephen\AppData\Local\scoop\apps\nodejs\0.12.1\nodejs\npm-check-updates.cmd

$ node -v
v0.12.1

$ which node
C:\Users\Stephen\AppData\Local\scoop\apps\nodejs\0.12.1\nodejs\node.exe

$ npm -v
2.7.5

$ which npm
C:\Users\Stephen\AppData\Local\scoop\apps\nodejs\0.12.1\nodejs\npm
C:\Users\Stephen\AppData\Local\scoop\apps\nodejs\0.12.1\nodejs\npm.cmd

$ node -e "console.log(require('global-prefix'))"
C:\Users\Stephen\appdata\local\scoop\apps\nodejs\0.12.1\nodejs

Now I've just updated to NodeJS v5.1.1, details and also everything works as expected :smile:

λ» npm-check-updates -g
You can now use ncu for less typing!

 npm-check-updates  2.1.2  →  2.5.2

New version details:

$ npm-check-updates --version
2.5.2

$ which npm-check-updates
C:\Users\Stephen\AppData\Local\scoop\apps\nodejs\5.1.1\nodejs\npm-check-updates
C:\Users\Stephen\AppData\Local\scoop\apps\nodejs\5.1.1\nodejs\npm-check-updates.cmd

$ node -v
v5.1.1

$ which node
C:\Users\Stephen\AppData\Local\scoop\apps\nodejs\5.1.1\nodejs\node.exe

$ npm -v
3.5.2

$ which npm
C:\Users\Stephen\AppData\Local\scoop\apps\nodejs\5.1.1\nodejs\npm
C:\Users\Stephen\AppData\Local\scoop\apps\nodejs\5.1.1\nodejs\npm.cmd

$ node -e "console.log(require('global-prefix'))"
C:\Users\Stephen\appdata\local\scoop\apps\nodejs\5.1.1\nodejs

So for me on Windows I have no problems as I use Scoop (https://github.com/lukesampson/scoop ) which is like Homebrew for Windows

ntwb commented 8 years ago

metaraine commented 6 hours ago @ntwb Try cebor's suggestion (also documented in Known Issues).

Indeed this works on Mac, thanks :+1:

raineorshine commented 8 years ago

@glen-84 It seems there is some problem with certain node installs where the npm prefix doesn't match the installed location, and thus npm.commands.list returns an empty result. I changed the behavior of ncu in global mode to use a spawned npm ls -g, which I am hoping will find your installed packages correctly now.

I won't release this on the latest branch until it is tested in a wider variety of environments, so for now it is available on the unstable branch:

$ npm install -g npm-check-updates@2.5.3-spawnglobal

I invite others to install this prerelease version and make sure it works in your environment. The only difference is in global mode: ncu -g. This will help before releasing it to stable. Thanks!

(Bonus: I fixed a performance bottleneck, so you should experience ~3x speed improvement with this version)

G3z commented 8 years ago

i think a dep is missing

~|⇒ npm install -g npm-check-updates@2.5.3-spawnglobal
/usr/local/bin/ncu -> /usr/local/lib/node_modules/npm-check-updates/bin/npm-check-updates
/usr/local/bin/npm-check-updates -> /usr/local/lib/node_modules/npm-check-updates/bin/old-alias
- readable-stream@2.0.4 node_modules/npm-check-updates/node_modules/duplexify/node_modules/readable-stream
- readable-stream@2.0.4 node_modules/npm-check-updates/node_modules/read-all-stream/node_modules/readable-stream
/usr/local/lib
└── npm-check-updates@2.5.3-spawnglobal

~|⇒ ncu -g
module.js:340
    throw err;
    ^

Error: Cannot find module 'spawn-please'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:289:25)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/usr/local/lib/node_modules/npm-check-updates/lib/package-managers/npm.js:4:13)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at requireDir (/usr/local/lib/node_modules/npm-check-updates/node_modules/require-dir/index.js:116:33)
    at Object.<anonymous> (/usr/local/lib/node_modules/npm-check-updates/lib/versionmanager.js:8:23)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
raineorshine commented 8 years ago

Oops! spawn-please was in devDependencies. Patching...

raineorshine commented 8 years ago

Try it now:

$ npm install -g npm-check-updates@2.5.4-spawnglobal
G3z commented 8 years ago

Node 5.1.0 installed via brew OsX El Capitain

~|⇒ npm install -g npm-check-updates@2.5.4-spawnglobal
/usr/local/bin/npm-check-updates -> /usr/local/lib/node_modules/npm-check-updates/bin/old-alias
/usr/local/bin/ncu -> /usr/local/lib/node_modules/npm-check-updates/bin/npm-check-updates
/usr/local/lib
└── npm-check-updates@2.5.4-spawnglobal
~|⇒ ncu -g
Unhandled rejection npm ERR! missing: node-pre-gyp@^0.6.15, required by fsevents@1.0.5
npm ERR! missing: npmlog@, required by npm-registry-client@7.0.7
npm ERR! invalid: npmlog@1.2.1 /usr/local/lib/node_modules/check-build/node_modules/nsp/node_modules/silent-npm-registry-client/node_modules/npm-registry-client/node_modules/npmlog
npm ERR! invalid: readable-stream@2.0.3 /usr/local/lib/node_modules/db-migrate/node_modules/mongodb/node_modules/readable-stream
npm ERR! missing: node-pre-gyp@^0.6.15, required by fsevents@1.0.5
npm ERR! missing: npmlog@, required by npm-registry-client@7.0.7
npm ERR! missing: npmlog@, required by npm-registry-client@7.0.7
npm ERR! invalid: pm2-axon@2.0.8 /usr/local/lib/node_modules/pm2/node_modules/pm2-axon
npm ERR! invalid: pm2-deploy@0.2.1 /usr/local/lib/node_modules/pm2/node_modules/pm2-deploy
npm ERR! invalid: pmx@0.5.5 /usr/local/lib/node_modules/pm2/node_modules/pmx
npm ERR! invalid: vizion@0.2.11 /usr/local/lib/node_modules/pm2/node_modules/vizion
npm ERR! missing: react-tools@git://github.com/facebook/react.git#b4e74e38e43ac53af8acd62c78c9213be0194245, required by react-native@0.13.2
npm ERR! missing: chokidar@^1.0.0, required by babel@5.8.29
npm ERR! missing: convert-source-map@^1.1.0, required by babel@5.8.29
npm ERR! missing: brace-expansion@^1.0.0, required by minimatch@3.0.0
npm ERR! missing: xtend@^4.0.0, required by output-file-sync@1.1.1
npm ERR! missing: babylon@^5.8.29, required by babel-core@5.8.33
npm ERR! missing: convert-source-map@^1.1.0, required by babel-core@5.8.33
npm ERR! missing: core-js@^1.0.0, required by babel-core@5.8.33
npm ERR! missing: fs-readdir-recursive@^0.1.0, required by babel-core@5.8.33
npm ERR! missing: lodash@^3.10.0, required by babel-core@5.8.33
npm ERR! missing: output-file-sync@^1.1.0, required by babel-core@5.8.33
npm ERR! missing: path-exists@^1.0.0, required by babel-core@5.8.33
npm ERR! missing: slash@^1.0.0, required by babel-core@5.8.33
npm ERR! missing: lodash@^3.9.3, required by babel-plugin-proto-to-assign@1.0.4
npm ERR! missing: number-is-nan@^1.0.0, required by is-finite@1.0.1
npm ERR! missing: commoner@~0.10.3, required by regenerator@0.8.40
npm ERR! missing: defs@~1.1.0, required by regenerator@0.8.40
npm ERR! missing: esprima-fb@~15001.1001.0-dev-harmony-fb, required by regenerator@0.8.40
npm ERR! missing: recast@0.10.33, required by regenerator@0.8.40
npm ERR! missing: through@~2.3.8, required by regenerator@0.8.40
npm ERR! missing: recast@^0.10.10, required by regexpu@1.3.0
npm ERR! missing: is-finite@^1.0.0, required by repeating@1.1.3
npm ERR! missing: amdefine@>=0.0.4, required by source-map@0.1.32
npm ERR! missing: type-is@~1.6.6, required by connect@2.30.2
npm ERR! missing: raw-body@~2.1.2, required by body-parser@1.13.3
npm ERR! missing: type-is@~1.6.6, required by body-parser@1.13.3
npm ERR! missing: mime-types@~2.1.6, required by accepts@1.2.13
npm ERR! missing: ms@0.7.1, required by connect-timeout@1.6.2
npm ERR! missing: uid-safe@~2.0.0, required by csrf@3.0.0
npm ERR! missing: accepts@~1.2.12, required by errorhandler@1.4.2
npm ERR! missing: base64-url@1.2.1, required by uid-safe@2.0.0
npm ERR! missing: escape-html@1.0.2, required by finalhandler@0.4.0
npm ERR! missing: on-finished@~2.3.0, required by finalhandler@0.4.0
npm ERR! missing: vary@~1.0.1, required by method-override@2.3.5
npm ERR! missing: on-finished@~2.3.0, required by morgan@1.6.1
npm ERR! missing: inherits@~2.0.1, required by readable-stream@1.1.13
npm ERR! missing: ms@0.7.1, required by serve-favicon@2.3.0
npm ERR! missing: accepts@~1.2.12, required by serve-index@1.7.2
npm ERR! missing: escape-html@1.0.2, required by serve-index@1.7.2
npm ERR! missing: mime-db@~1.19.0, required by mime-types@2.1.7
npm ERR! missing: escape-html@1.0.2, required by serve-static@1.10.0
npm ERR! missing: escape-html@1.0.2, required by send@0.13.0
npm ERR! missing: etag@~1.7.0, required by send@0.13.0
npm ERR! missing: mime@1.3.4, required by send@0.13.0
npm ERR! missing: ms@0.7.1, required by send@0.13.0
npm ERR! missing: on-finished@~2.3.0, required by send@0.13.0
npm ERR! missing: statuses@~1.2.1, required by send@0.13.0
npm ERR! missing: core-js@^1.0.0, required by fbjs-scripts@0.2.2
npm ERR! missing: dateformat@^1.0.11, required by gulp-util@3.0.7
npm ERR! missing: minimist@^1.1.0, required by gulp-util@3.0.7
npm ERR! missing: dateformat@^1.0.11, required by fancy-log@1.1.0
npm ERR! missing: sparkles@^1.0.0, required by glogg@1.0.0
npm ERR! missing: lodash._isiterateecall@^3.0.0, required by lodash.template@3.6.2
npm ERR! missing: lodash.isarguments@^3.0.0, required by lodash.keys@3.1.2
npm ERR! missing: lodash.isarray@^3.0.0, required by lodash.keys@3.1.2
npm ERR! missing: duplexer2@0.0.2, required by multipipe@0.1.2
npm ERR! missing: readable-stream@~2.0.0, required by through2@2.0.0
npm ERR! missing: xtend@~4.0.0, required by through2@2.0.0
npm ERR! missing: commoner@^0.10.1, required by jstransform@11.0.3
npm ERR! missing: JSONStream@^1.0.3, required by module-deps@3.9.1
npm ERR! missing: detective@^4.0.0, required by module-deps@3.9.1
npm ERR! missing: resolve@^1.1.3, required by module-deps@3.9.1
npm ERR! missing: xtend@^4.0.0, required by module-deps@3.9.1
npm ERR! missing: resolve@1.1.6, required by browser-resolve@1.10.1
npm ERR! missing: core-util-is@~1.0.0, required by readable-stream@1.0.33
npm ERR! missing: isarray@0.0.1, required by readable-stream@1.0.33
npm ERR! missing: string_decoder@~0.10.x, required by readable-stream@1.0.33
npm ERR! missing: minimist@^1.1.0, required by subarg@1.0.0
npm ERR! missing: xtend@>=4.0.0 <4.1.0-0, required by through2@1.1.1
npm ERR! missing: commoner@~0.10.3, required by regenerator@0.8.41
npm ERR! missing: private@~0.1.5, required by regenerator@0.8.41
npm ERR! missing: decamelize@^1.0.0, required by yargs@3.27.0
npm ERR! missing: os-locale@^1.4.0, required by yargs@3.27.0
npm ERR! missing: window-size@^0.1.2, required by yargs@3.27.0
npm ERR! missing: y18n@^3.2.0, required by yargs@3.27.0
npm ERR! missing: lazy-cache@^0.2.4, required by center-align@0.1.2
npm ERR! missing: align-text@^0.1.1, required by right-align@0.1.3
npm ERR! missing: private@~0.1.5, required by recast@0.10.33
npm ERR! missing: lru-cache@2, required by minimatch@0.2.14
npm ERR! missing: xtend@>=4.0.0 <4.1.0-0, required by worker-farm@1.3.1
npm ERR! missing: bindings@1.2.x, required by utf-8-validate@1.2.1
npm ERR! missing: nan@^2.0.5, required by utf-8-validate@1.2.1
npm ERR! missing: window-size@^0.1.2, required by yargs@3.29.0
npm ERR! missing: number-is-nan@^1.0.0, required by code-point-at@1.0.0
npm ERR! missing: number-is-nan@^1.0.0, required by is-fullwidth-code-point@1.0.0
npm ERR! missing: ansi-regex@^2.0.0, required by strip-ansi@3.0.0
npm ERR! missing: diff@^2.1.2, required by yeoman-environment@1.3.0
npm ERR! missing: grouped-queue@^0.3.0, required by yeoman-environment@1.3.0
npm ERR! missing: lodash@^3.1.0, required by yeoman-environment@1.3.0
npm ERR! missing: mem-fs@^1.1.0, required by yeoman-environment@1.3.0
npm ERR! missing: arrify@^1.0.0, required by globby@3.0.1
npm ERR! missing: glob@^5.0.3, required by globby@3.0.1
npm ERR! missing: object-assign@^4.0.1, required by globby@3.0.1
npm ERR! missing: array-uniq@^1.0.1, required by array-union@1.0.1
npm ERR! missing: ansi-regex@^2.0.0, required by inquirer@0.11.0
npm ERR! missing: lodash@^3.3.1, required by inquirer@0.11.0
npm ERR! missing: run-async@^0.1.0, required by inquirer@0.11.0
npm ERR! missing: strip-ansi@^3.0.0, required by inquirer@0.11.0
npm ERR! missing: through@^2.3.6, required by inquirer@0.11.0
npm ERR! missing: onetime@^1.0.0, required by restore-cursor@1.0.1
npm ERR! missing: code-point-at@^1.0.0, required by readline2@1.0.1
npm ERR! missing: is-fullwidth-code-point@^1.0.0, required by readline2@1.0.1
npm ERR! missing: cross-spawn@^2.0.0, required by yeoman-generator@0.20.3
npm ERR! missing: dateformat@^1.0.11, required by yeoman-generator@0.20.3
npm ERR! missing: diff@^2.0.2, required by yeoman-generator@0.20.3
npm ERR! missing: download@^4.1.2, required by yeoman-generator@0.20.3
npm ERR! missing: github-username@^2.0.0, required by yeoman-generator@0.20.3
npm ERR! missing: lodash@^3.5.0, required by yeoman-generator@0.20.3
npm ERR! missing: mem-fs-editor@^2.0.0, required by yeoman-generator@0.20.3
npm ERR! missing: path-exists@^1.0.0, required by yeoman-generator@0.20.3
npm ERR! missing: path-is-absolute@^1.0.0, required by yeoman-generator@0.20.3
npm ERR! missing: text-table@^0.2.0, required by yeoman-generator@0.20.3
npm ERR! missing: through2@^2.0.0, required by yeoman-generator@0.20.3
npm ERR! missing: inflight@^1.0.4, required by glob@4.3.5
npm ERR! missing: inherits@2, required by glob@4.3.5
npm ERR! missing: minimatch@^2.0.1, required by glob@4.3.5
npm ERR! missing: once@^1.3.0, required by glob@4.3.5
npm ERR! missing: once@^1.3.0, required by glob@5.0.15
npm ERR! missing: path-is-absolute@^1.0.0, required by glob@5.0.15
npm ERR! missing: once@^1.3.0, required by inflight@1.0.4
npm ERR! missing: wrappy@1, required by inflight@1.0.4
npm ERR! missing: brace-expansion@^1.0.0, required by minimatch@3.0.0
npm ERR! missing: lodash@^3.2.0, required by gruntfile-editor@1.1.0
npm ERR! missing: escodegen@^1.6.0, required by ast-query@1.0.1
npm ERR! missing: esprima@^2.0.0, required by ast-query@1.0.1
npm ERR! missing: lodash@^3.2.0, required by ast-query@1.0.1
npm ERR! missing: lodash@^3.2.0, required by cheerio@0.19.0
npm ERR! missing: domelementtype@1, required by domutils@1.4.3
npm ERR! missing: readable-stream@1.1, required by htmlparser2@3.8.3
npm ERR! missing: get-stdin@^4.0.1, required by detect-newline@1.0.3
npm ERR! missing: minimist@^1.1.0, required by detect-newline@1.0.3
npm ERR! missing: cli-width@^1.0.1, required by inquirer@0.8.5
npm ERR! missing: figures@^1.3.5, required by inquirer@0.8.5
npm ERR! missing: lodash@^3.3.1, required by inquirer@0.8.5
npm ERR! missing: through@^2.3.6, required by inquirer@0.8.5
npm ERR! missing: get-stdin@^4.0.1, required by pretty-bytes@2.0.1
npm ERR! missing: meow@^3.1.0, required by pretty-bytes@2.0.1
npm ERR! missing: number-is-nan@^1.0.0, required by pretty-bytes@2.0.1
npm ERR! missing: once@^1.3.0, required by run-async@0.1.0
npm ERR! missing: inherits@2.0.1, required by util@0.10.3
npm ERR! missing: os-homedir@^1.0.0, required by user-home@2.0.0
npm ERR! missing: os-homedir@^1.0.0, required by xdg-basedir@2.0.0
npm ERR! missing: lodash@^3.6.0, required by yeoman-assert@2.1.0
npm ERR! missing: path-exists@^1.0.0, required by yeoman-assert@2.1.0
npm ERR! invalid: harvest@0.2.0 /usr/local/lib/node_modules/revenue-core/node_modules/harvest
npm ERR! invalid: adler-32@0.2.1 /usr/local/lib/node_modules/sqlpad/node_modules/node-xlsx/node_modules/xlsx/node_modules/adler-32
npm ERR! invalid: commander@2.9.0 /usr/local/lib/node_modules/sqlpad/node_modules/node-xlsx/node_modules/xlsx/node_modules/commander
npm ERR! invalid: crc-32@0.3.0 /usr/local/lib/node_modules/sqlpad/node_modules/node-xlsx/node_modules/xlsx/node_modules/crc-32
npm ERR! missing: commander@, required by cfb@0.10.3
npm ERR! missing: commander@, required by codepage@1.3.8
npm ERR! invalid: concat-stream@1.5.1 /usr/local/lib/node_modules/sqlpad/node_modules/node-xlsx/node_modules/xlsx/node_modules/codepage/node_modules/concat-stream
npm ERR! invalid: voc@0.5.0 /usr/local/lib/node_modules/sqlpad/node_modules/node-xlsx/node_modules/xlsx/node_modules/codepage/node_modules/voc
npm ERR! invalid: voc@0.5.0 /usr/local/lib/node_modules/sqlpad/node_modules/node-xlsx/node_modules/xlsx/node_modules/ssf/node_modules/voc
~|⇒ npm outdated -g
Package                            Current             Wanted            Latest  Location
actionhero                          12.2.0             12.3.0            12.3.0
ava                                  0.4.2              0.7.0             0.7.0
babel                               6.1.18             6.3.13            6.3.13
babel-cli                            6.2.0             6.3.15            6.3.15
babel-core                           6.2.1             6.3.15            6.3.15
bower                                1.6.8              1.6.9             1.6.9
check-build                          2.2.1              2.6.0             2.6.0
cordova-ios                          3.9.1              3.9.2             3.9.2
db-migrate                          0.9.23             0.9.23     0.10.0-beta.6
generator-fluxible                   1.2.0              1.2.4             1.2.4
generator-keystone                   0.3.9             0.3.10            0.3.10
generator-react-webpack              2.2.7              3.1.1             3.1.1
git-stats-importer                   2.2.0              2.4.0             2.4.0
harvest                              0.2.0              0.1.3             0.1.3
ios-deploy                           1.8.2              1.8.3             1.8.3
ios-sim                              5.0.3              5.0.4             5.0.4
mocha                                2.3.3              2.3.4             2.3.4
nexe                                 0.4.1              0.4.2             0.4.2
node-gyp                             3.2.0              3.2.1             3.2.1
node-inspector                      0.12.3             0.12.4            0.12.4
npm                                  3.5.0              3.5.2             3.5.1
npm-check-updates        2.5.4-spawnglobal  2.5.4-spawnglobal             2.5.4
phonegap                             5.3.6              5.3.9             5.3.9
plugman                              1.0.4              1.0.5             1.0.5
pm2                                 0.15.8            0.15.10           0.15.10
react-native                        0.13.2             0.16.0            0.16.0
react-ui-builder                     0.3.4              0.3.4  0.3.5-deprecated
sequelize                           3.13.0             3.14.2            3.14.2
sqlpad                              1.10.0             1.12.0            1.12.0
webpack                             1.12.2             1.12.9            1.12.9
yo                                   1.4.8              1.5.0             1.5.0
raineorshine commented 8 years ago

Shoot. I don't know why it is reporting errors for nested dependencies when I am explicitly setting --depth 0.

raineorshine commented 8 years ago

@G3z Is harvest a linked module? Because you have 0.2.0 installed, which doesn't appear to have been published. That explains the invalid error but not all the missing errors. Maybe ncu should ignore missing/invalid global dependencies.

glen-84 commented 8 years ago
$ npm install -g npm-check-updates@2.5.4-spawnglobal
C:\Users\Glen\AppData\Roaming\npm\npm-check-updates -> C:\Users\Glen\AppData\Roaming\npm\node_modules\npm-check-updates\bin\old-alias
C:\Users\Glen\AppData\Roaming\npm\ncu -> C:\Users\Glen\AppData\Roaming\npm\node_modules\npm-check-updates\bin\npm-check-updates
- readable-stream@2.0.4 node_modules\npm-check-updates\node_modules\duplexify\node_modules\readable-stream
- readable-stream@2.0.4 node_modules\npm-check-updates\node_modules\read-all-stream\node_modules\readable-stream
C:\Users\Glen\AppData\Roaming\npm
└─┬ npm-check-updates@2.5.4-spawnglobal
  ├─┬ npm@3.5.1
  │ └─┬ npm-registry-client@7.0.9
  │   └─┬ concat-stream@1.5.1
  │     └── readable-stream@2.0.4
  ├─┬ npmi@1.0.1
  │ └─┬ npm@2.14.14
  │   ├── fs-write-stream-atomic@1.0.5
  │   ├── imurmurhash@0.1.4
  │   ├─┬ node-gyp@3.2.1
  │   │ └─┬ glob@4.5.3
  │   │   └─┬ minimatch@2.0.10
  │   │     └─┬ brace-expansion@1.1.2
  │   │       └── balanced-match@0.3.0
  │   ├─┬ npm-registry-client@7.0.8
  │   │ ├─┬ concat-stream@1.5.1
  │   │ │ └── readable-stream@2.0.4
  │   │ └─┬ npmlog@2.0.0
  │   │   └─┬ are-we-there-yet@1.0.5
  │   │     └─┬ readable-stream@2.0.4
  │   │       └── process-nextick-args@1.0.6
  │   └── write-file-atomic@1.1.4
  ├── spawn-please@0.1.0
  └─┬ update-notifier@0.5.0
    └─┬ configstore@1.3.0
      └─┬ write-file-atomic@1.1.4
        └── imurmurhash@0.1.4

$ ncu -g

┌─────────────────────────────────────────────────┐
│ Update available: 2.5.4 (current: 2.5.2)        │
│ Run npm install -g npm-check-updates to update. │
└─────────────────────────────────────────────────┘

Unhandled rejection Error: spawn npm ENOENT
    at exports._errnoException (util.js:856:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at doNTCallback2 (node.js:452:9)
    at process._tickCallback (node.js:366:17)
From previous event:
    at doNTCallback0 (node.js:430:9)
    at process._tickCallback (node.js:359:13)
From previous event:
    at Object.module.exports._.merge.run (C:\Users\Glen\AppData\Roaming\npm\node_modules\npm-check-updates\lib\npm-check-updates.js:400:12)
    at Object.<anonymous> (C:\Users\Glen\AppData\Roaming\npm\node_modules\npm-check-updates\bin\npm-check-updates:38:5)
    at Module._compile (module.js:425:26)
    at Object.Module._extensions..js (module.js:432:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:313:12)
    at Function.Module.runMain (module.js:457:10)
    at startup (node.js:138:18)
    at node.js:974:3

$ ncu --version
2.5.4-spawnglobal
glen-84 commented 8 years ago

Does this have anything to do with the fact that there is an npmrc file in C:\Program Files\nodejs\node_modules\npm that points to prefix=${APPDATA}\npm (the actual location of my global packages)?

raineorshine commented 8 years ago

I'm kind of stumped :/

G3z commented 8 years ago

yes @metaraine harvest is a linked module

sidneys commented 8 years ago

I have the same problem, on OSX. Node is installed via the "n" module:

$:  ncu -g --loglevel silly
Initializing...
Running in global mode...
Getting installed packages...
{}

Fetching latest versions...
{}

All global packages are up-to-date :)

Adding PREFIX="/usr/local/" does not change the result.

ntwb commented 8 years ago

I just added an alias to my bash profile alias ncug='PREFIX="/usr/local/" ncu -g', maybe I'll remember ncug from now on ;)

kurtextrem commented 8 years ago

I have the same problem: http://prntscr.com/amslcf

nielsgl commented 8 years ago

The problem indeed seems to be that the prefix path in the npm config is not setup correct when you have installed npm via homebrew (due to the symlinks created by homebrew), you can see the difference when you run in your terminal: npm config get prefix -g that will return /usr/local, and the global node_modules folder can be found with npm root -g.

You can verify the differences in the paths during the init function in lib/package-manages/npm.js, by adding on line 60 before the return statement:

console.log(npm.config.get('prefix'));
console.log(npm.commands.root('-g'));

then if you run the npm-check-updates command from the repository with ./bin/npm-check-updates -g and see that it returns the wrong paths (5.11.0 is my node version)

/usr/local/Cellar/node/5.11.0
/usr/local/Cellar/node/5.11.0/lib/node_modules

@metaraine I will send a PR with a fix for homebrew, will also look into @SidneyS 's problem using the n module.

raineorshine commented 8 years ago

@nielsgl Thank you! That is awesome that you have looked into this. Much appreciated!

I will comment here instead of on the pull request (#231) so that the conversations stays in one place.

One thing I am concerned about is compatibility with nvm. I have node installed via nvm, so when I run npm config get prefix -g I get /Users/raine/.nvm/versions/node/v5.5.0. Would setting npm.config.set('prefix', '/usr/local') be incorrect in this situation?

nielsgl commented 8 years ago

@metaraine the pull request that I submitted shouldn't affect you, though I haven't tested it. I will install nvm and n tonight and see if they still work and if not how to fix it :)

raineorshine commented 8 years ago

Terrific! Thanks!

On Mon, Apr 25, 2016 at 9:42 AM Niels van Galen Last < notifications@github.com> wrote:

@metaraine https://github.com/metaraine the pull request that I submitted shouldn't affect you, though I haven't tested it. I will install nvm and n tonight and see if they still work and if not how to fix it :)

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/tjunnone/npm-check-updates/issues/146#issuecomment-214403779