Hey,
I am updating existing global module, but it doesn't update even if the module is updated in node_modules.
For example,
$ npm i -g serverless # it's successfully installed, and I've confirmed in node_modules
$ serverless --version # this will print old version yet even if I restart the terminal
What's the problem?
What does which npm and which serverless print out?
Also, please always fill out the entire issue template - it's there for a reason.
@ljharb Thanks for your response.
Even if I install new version, it doesn't update version. which npm -> 5.10, which serverless -> 1.29.1
I've found out the reason. npm install didn't install latest version.
It's successfully installed, but just not updated version.
When I've been using just npm without nvm, I could update packages simply by running the following commands.
$npm i -g <package>
But after I started to use npm installed by nvm, it doesn't work any more.
I had to update the packages as below:
$npm update -g <package>
Thanks
That's definitely not a solution; what's probably happening is that your global npm/node is shadowing the nvm one, which would be clear if you'd filled out the issue template.
Try uninstalling your system node/npm, and then everything should work (without ever needing npm update).
Thanks for your answer @ljharb
But I have no node or npm in my system.
I've just installed them from nvm.
I’m happy to reopen this if you can fill out the issue template.
Oh, Thanks.
But It was too cumbersome to fill out..
maybe when I have some time later days, I will create new issue then.
Please update this one at that time, rather than filing a new one. Thanks!
Got it @ljharb Thanks for your amazing support and responsibility!
I love NVM!
Hi @ljharb
It's my bad. the package I've tried to update was one installed originally by system npm.
This is not an issue with NVM.
Thanks again!
Most helpful comment
Hi @ljharb
It's my bad. the package I've tried to update was one installed originally by system npm.
This is not an issue with NVM.
Thanks again!