1

I was having trouble in updating my npm. I updated my node from v6 to v10. And was wondering what version of npm is installed with the version of v10? or does it remain same ? because in my case it was still showing same old version of npm which is 3.3.12, could not able to update it to 6.5.0. there was some constant error coming which was really annoying every time. So i tried to uninstall node and install it again and again. But it is not working. for people to know i am using windows 7. The error that i get when i try to update npm using command :

npm install --global --production npm-windows-upgrade

Error: Cannot find module 'internal/util/types'

and when i run : npm-windows-upgrade --npm-version latest , i get the error to reinstall node as there was error in installing npm upgrade. Please suggest me what to do

heman123
  • 3,009
  • 4
  • 24
  • 37
  • Possible duplicate of [How can I update NodeJS and NPM to the next versions?](https://stackoverflow.com/questions/6237295/how-can-i-update-nodejs-and-npm-to-the-next-versions) – Patrick Roberts Dec 28 '18 at 03:27

2 Answers2

2

Update node version:

Use n module from npm in order to upgrade node

sudo npm cache clean -f sudo npm install -g n sudo n stable

To upgrade to latest version (and not current stable) version, you can use

sudo n latest

You will be found latest version for both npm and node

Raghbendra Nayak
  • 1,606
  • 3
  • 22
  • 47
0

How about npm rebuild it? Hopefully, it would help you. If not working, reinstalling node and clearing npm cache could be fixed probably.

PPShein
  • 13,309
  • 42
  • 142
  • 227