Loredra L
Loredra L

Reputation: 1553

Using npm with sudo return: "NPM is not known..." bug

When i am using sudo npm it returns the

ERROR: npm is known not to run on Node.js v4.4.5

while running without sudo is fine.

More confusing is that my node -v is v9.8.0 but nodejs -v is v0.10 .None of them is v4.4.5

How can I resolve this.

Upvotes: 0

Views: 91

Answers (1)

Abslen Char
Abslen Char

Reputation: 3135

I believe that you have 2 version of npm installed you need to remove them all and install a fresh version of npm

sudo npm uninstall npm -g

try also to remove everything related to npm

rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*

and then re install a fresh version of npm

Upvotes: 1

Related Questions