zkat / npx

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

Bad advice when locally-installed deps are out of date #52

Closed tamzinblake closed 7 years ago

tamzinblake commented 7 years ago

See https://github.com/yeoman/update-notifier/issues/112

In this example, npx is using the locally-installed version of bower (node_modules/.bin/bower). update-notifier is correctly noticing that we're not using the latest version, but it suggests that npm i -g bower will fix that, which it will not, since it'll still use the locally-installed version, which is old.

For now, npx could probably fix this problem by setting isGlobal to the appropriate value in update-notifier?

https://github.com/yeoman/update-notifier#isglobal

zkat commented 7 years ago

How can npx itself do anything about this, itself? The update-notifier calls that require isGlobal are for those libraries themselves, not for npx. I can set it in npx itself, but that wouldn't necessarily fix this since npx is very much meant to be a unique global install.

tamzinblake commented 7 years ago

If I'm not mistaken, on this line https://github.com/zkat/npx/blob/612f7ab66c8ad979251178b285f2a7d6e5a61a00/index.js#L71

We could pass the option isGlobal set to whether the package we're notifying about is global (if npx knows that at the time which I haven't determined)

zkat commented 7 years ago

No, that line only applies to npx's own notifier. It won't affect the packages it's running. :/

tamzinblake commented 7 years ago

:sadface: