When I do a npm -v
I see that I am still on 5.6.0. And keep getting prompts to do a npm i npm
.
But I've done a sudo npm install npm@latest -g
and double checked with a npm outdated -g --depth=0
to see that my global npm is at the latest already (6.0.0).
How do I resolve this conflict? Is the npm I'm using the latest or is it still the old one? Is it because my global is linked incorrectly or something?
You can downgrade the npm version by specifying a version in the related commands. If you want to downgrade npm to a specific version, you can use the following command: npm install -g npm@[version. number] where the number can be like 4.9. 1 or 8 or v6.
Keep in mind that with npm update it will never update to a major breaking-changes version. It updates the dependencies in package. json and package-lock. json.
To completely uninstall node + npm is to do the following: go to /usr/local/lib and delete any node and node_modules. go to /usr/local/include and delete any node and node_modules directory. if you installed with brew install node, then run brew uninstall node in your terminal.
Try closing the Terminal - once you open it again it should work, worked for me well.
*IvanD wrote this solution in a comment to the original post, I thought it's worth an answer post.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With