0

I have node version 4.2.6 installed in my machine. I have successfully installed npm as well but when I use npm -v it gives the following error

ERROR: npm is known not to run on Node.js v4.2.6
Node.js 4 is supported but the specific version you're running has
a bug known to break npm. Please update to at least ${rel.min} to use this
version of npm. You can find the latest release of Node.js at https://nodejs.org/
Zanna
  • 70,465
Ninja
  • 119

1 Answers1

0

First, completely uninstall nodejs and npm.

sudo apt remove nodejs npm

afterwards type npm -v or nodejs -v, and if it returns something like didn't find in folder /usr/bin/nodejs

You will need to delete the old files of npm and nodejs. For example you could try

sudo apt remove --purge nodejs npm

After deleting try again npm -v or nodejs -v

If it returns is not installed, to install type 'sudo apt-get install nodejs', then you can install nodejs and npm. This worked for me on Ubuntu 16.04

Zanna
  • 70,465