0

I've dual Boot(ubuntu/Windows 10) on my laptop. I am getting this error and I can't run npm install on Ubuntu. I checked with node -v and it shows v17.4.0 :

npm does not support Node.js v13.14.0

npm ERR! Invalid or unexpected token

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/diana/.npm/_logs/2022-02-12T09_42_18_704Z-debug-0.log

Update: I had to uninstall and remove all the folders related to node and npm. I've also installed the latest version of nvm 0.39 and only then I managed to actually upgrade the node to the right version. Everything is working now.

How can I completely uninstall nodejs, npm and node in Ubuntu

Ina
  • 27
  • 6

1 Answers1

0

Have you tried updating your npm?

If no, run this:

sudo apt-get install -y npm

or check this:

https://stackoverflow.com/questions/23393707/how-to-update-npm#:~:text=sudo%20add%2Dapt%2Drepository%20ppa%3Achris%2Dlea/node.js%0Asudo%20apt%2Dget%20update%0Asudo%20apt%2Dget%20install%20nodejs%20npm

takudzw_M
  • 186
  • 1
  • 5
  • I tried and it says: ``` npm does not support Node.js v13.14.0 You should probably upgrade to a newer version of node as we can't make any promises that npm will work with this version. You can find the latest version at https://nodejs.org/ `` when I run node -v it shows v17.4.0 – Ina Feb 12 '22 at 10:18
  • this should work: sudo apt-get install -y npm – takudzw_M Feb 12 '22 at 10:21