npm / cli

the package manager for JavaScript
https://docs.npmjs.com/cli/
Other
8.49k stars 3.18k forks source link

[BUG] Installing a newer version of the package doesn't update the source code to be used #1884

Closed YuryShkoda closed 3 years ago

YuryShkoda commented 4 years ago

Current Behavior:

If you install an older version of the package npm i -g <package> and after that install a newer version of it npm i -g <package>@latest, the latest source code will be downloaded, but the functionality will be used from older version. If you change any of the files located at /usr/local/lib/node_modules/<package>, npm will pick up the right source code.

Expected Behavior:

The right source code should be used after installing a newer version.

Steps To Reproduce:

  1. npm i -g @sasjs/cli@1.12.0
  2. sasjs -v - to get the version of this package
  3. sasjs folder create
  4. See 'Invalid SASjs command! Run sasjs help for a full list of available commands.'
  5. npm i -g @sasjs/cli@latest
  6. sasjs -v - to get the version of this package
  7. sasjs folder create
  8. See 'Invalid SASjs command! Run sasjs help for a full list of available commands.'
  9. cd /usr/local/lib/node_modules
  10. rm -rf @sasjs
  11. npm i -g @sasjs/cli@latest
  12. sasjs folder create
  13. See Target name wasn't provided. Using 1 by default.

Environment:

allanbowe commented 3 years ago

Is anyone else aware of this issue?

allanbowe commented 3 years ago

@darcyclarke - is there a reason to remove the label? is this considered a nofix?

darcyclarke commented 3 years ago

npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.

If your bug is preproducible on v7, please re-file this issue using our new issue template.

If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo

Closing: This is an automated message.