JavaEar 专注于收集分享传播有价值的技术资料

Homebrew npm install: could not symlink

So I made the mistake of trying to get rid of all sudo dependencies. I downloaded npm as a package from the site and did a manual/global install. But it seemed as if i was always having to run with I tried to uninstall and run with homebrew.

Now I can't get node or npm to even run...I guess I have to link with brew link them but i'm getting this error:

Could not symlink share/doc/node/gdbinit
Target /usr/local/share/doc/node/gdbinit
already exists. You may want to remove it:
  rm '/usr/local/share/doc/node/gdbinit'

I've tried removing that: And i've gotten permission denied.

I have tried running brew prune. I have tried to uninstall then reinstall using these steps:

$ brew uninstall npm
$ brew uninstall node
$ npm uninstall npm -g
$ sudo rm -rf /usr/local/lib/node_module

Error: The 'brew link' step did not complete successfully

I am running Yosemite 10.10.5. I have git version 2.6.0 installed. My homebrew is updated. A brew doctor gives me this warning:

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:

Not sure where to go from here. I'm trying to lose my reliance on CodeKit and get gulp up and running.