zkat / npx

execute npm package binaries (moved)
https://github.com/npm/npx
Other
2.63k stars 105 forks source link

Update prompt suggests command which doesn't update npx #94

Closed jesstelford closed 7 years ago

jesstelford commented 7 years ago

At some point, after running a few npx commands, I saw this prompt:

   ╭─────────────────────────────────────╮
   │                                     │
   │   Update available 9.0.3 → 9.2.2    │
   │    Run npm i -g libnpx to update    │
   │                                     │
   ╰─────────────────────────────────────╯

(I'm not sure how to reproduce seeing that prompt - looks to be on a timer of some sort?)

I ran the suggested commands:

$ npx --version
9.0.3
$ npm i -g libnpx
+ libnpx@9.3.2
added 155 packages in 3.704s
$ npx --version
9.0.3

Note the version of npx has not changed.

I am using the npx which comes with npm:

$ which npx
/Users/jess.telford/.nvm/versions/node/v7.10.0/bin/npx
$ node --version
v7.10.0
$ npm --version
5.2.0

Extra Investigation

I am able to update the version of npx with npm i -g npx, however that appears to overwrite the global npm version of npx with the new version:

$ npm i -g npx
/Users/jess.telford/.nvm/versions/node/v7.10.0/bin/npx -> /Users/jess.telford/.nvm/versions/node/v7.10.0/lib/node_modules/npx/index.js
+ npx@9.3.2
added 507 packages in 9.423s
$ npx --version
9.3.2

I'm not sure if this has any consequences when updating npm in the future?

zkat commented 7 years ago

The first issue was fixed by https://github.com/zkat/npx/commit/c3027a96734e3e3346bc0948c63b15d4f33ca200

The issue with npm i -g npx clobbering the npm-bundled npx is working as expected. That is the behavior as specified and desired.