Installing node with homebrew problems mac OS

痞子三分冷 提交于 2019-12-19 11:44:12

问题


after installing homebrew,

after running brew install node

I test with:

node --version

I get:

command not found

If I rerun the install command: I get:

MacBook-Pro:~ evanloiterman$ brew install node Warning: node 10.9.0 is already installed, it's just not linked You can use brew link node to link this version. MacBook-Pro:~ evanloiterman$ brew link node Linking /usr/local/Cellar/node/10.9.0... Error: Could not symlink include/node/common.gypi Target /usr/local/include/node/common.gypi already exists. You may want to remove it: rm '/usr/local/include/node/common.gypi'

I try brew link node

I get:

Error: Could not symlink include/node/common.gypi Target /usr/local/include/node/common.gypi already exists. You may want to remove it: rm '/usr/local/include/node/common.gypi'

To force the link and overwrite all conflicting files: brew link --overwrite node

To list all files that would be deleted: brew link --overwrite --dry-run node

What should I try next to ensure this is working?


回答1:


You should install NVM (Node Version Manager). With this tool you can choose which node to use and install.

https://nodesource.com/blog/installing-node-js-tutorial-using-nvm-on-mac-os-x-and-ubuntu/




回答2:


If you want to run Homebrew UNINSTALL node and begin clean.

To fix this problem I found the answer on this site:

uninstall homebrew on a mac

I ran the ruby script and then decided to just start clean again and forget about homebrew for now.



来源:https://stackoverflow.com/questions/52194825/installing-node-with-homebrew-problems-mac-os

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!