Out Of Date Warning
This article was published on 02 Apr 2016, this means the content may be out of date or no longer relevant. You should verify that the technical information in this article is still current before relying upon it for your own purposes.
I have recently installed node.js from the official website via package installer on my Mac. I’ve run into an issue, though, after running
npm update -g it brokes npm. The funny thing is that node.js works. But npm show errors:
npm: command not found.
After research on github and stackoverflow issues I’ve found that on Mac it’s better idea to install nodejs via homebrew. The following steps solve this problem:
- brew uninstall node
- brew update
- brew upgrade
- brew cleanup
- brew install node
- sudo chown -R $(whoami) /usr/local (for issues with permissions)
- brew link –overwrite node
- brew postinstall node
And then everything works fine.