djfdev
djfdev

Reputation: 6037

brew install node error

I'm having trouble installing node via homebrew.

$ brew install node

Which returns:

node: Beginning with 0.8.0, this recipe now comes with npm.
It appears you already have npm installed at /usr/local/lib/node_modules/npm.
To use the npm that comes with this recipe, first uninstall npm with
`npm uninstall npm -g`, then run this command again.

If you would like to keep your installation of npm instead of
using the one provided with homebrew, install the formula with
the `--without-npm` option.
Error: An unsatisfied requirement failed this build.

When I run npm uninstall i get a command not found error. Any suggestions?

Note: at one point in time, I had uninstalled brew and npm. I'm thinking some leftover package is causing this error?

Upvotes: 1

Views: 4008

Answers (2)

Lucian Enache
Lucian Enache

Reputation: 2520

I tend to believe that you have installed node bot didn't mapped node to the system PATH variable, check that, and if so to uninstall map first your old installation and you should be ok

Upvotes: 0

Andy
Andy

Reputation: 30418

Do you have a version of node installed that isn't from homebrew? If not, then even if npm is in your path, it probably wouldn't run since it requires node in order to run.

Assuming you want to start fresh with node from homebrew, you should be safe to delete the /usr/local/lib/nodemodules/ directory. This should get rid of the homebrew warning. You might want to make note of anything installed there first so you can reinstall it once node and npm are installed via homebrew.

Upvotes: 3

Related Questions