user888734
user888734

Reputation: 3897

Can't update npm - code EN0ENT -2

I just used Homebrew to install Node. It seemed alright but when I try to update npm with

npm install -g npm

I get the following error:

ERR! addLocal Could not install /Users/myusername/-g
ERR! Darwin 14.3.0
ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "npm"
ERR! node v0.12.7
ERR! npm v2.14.2
ERR! path /Users/myusername/-g
ERR! code EN0ENT
ERR! errno -2

ERR! enoent EN0NT, open '/Users/myusername/-g'

Upvotes: 0

Views: 124

Answers (1)

Drown
Drown

Reputation: 5982

This worked for me in the past with a similar issue:

npm cache clean

You can also try running it as sudo

sudo npm install -g npm

Upvotes: 1

Related Questions