1

I have installed homebrew via boxen. I did not know that npm update -g is a bad thing to do, as npm runs amok trying to update itself. Hence, npm stopped working. I am now trying to get node and npm back to work again.

I have installed the node via homebrew:

$ brew unlink node && brew link node
Unlinking /opt/boxen/homebrew/Cellar/node/0.10.26... 5 symlinks removed
Linking /opt/boxen/homebrew/Cellar/node/0.10.26... 4 symlinks created

Yet npm claims that

$ npm
nodenv: version `v0.10.26' is not installed

Running nodenv indeed shows that the current version is not found:

$ nodenv versions
v0.10
v0.10.21
v0.6
v0.6.20
v0.8
v0.8.8

I am confused as to why nodenev shows all the versions it does.

How do I fix nodejs and npm?

1
  • You probably want to uninstall it not just link - note that you can really only use one package manager as they will conflict as shown here – mmmmmm May 2 '14 at 11:39
2

I consider this a workaround, if there is a way to get node upgraded the brew way, I appreciate it.

It seems that boxen in its standard configuration only provides v0.10.21 yet once npm updated itself, it expects v0.10.26.

I tried to reconfigure boxen to install node yet failed.

I then went along and installed NodeJs manually over the pgk provided by nodejs.org and globally installed node 0.10.26. Then nodenv was able to find that version and by setting

nodenv global v0.10.26

npm started working again. I then had to reinstall certain packages not expecting that v0.10.26 version, e.g. bower version.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .