npm 安装报错 Error: The 'brew link' step did not complete successfully

Step 1: Update Homebrew

$ brew update
Step 2: Remove node/npm everywhere on your system

Some of these commands are not necessary depending on how you installed node/npm in the past.

$ brew uninstall npm
$ brew uninstall node
$ npm uninstall npm -g
$ sudo rm -rf /usr/local/lib/node_modules
Note: I had stray node files that I found by running brew -v link node (which gave me the verbose output of the linking errors brew was complaining about). You may need to:

$ sudo rm -rf /usr/local/include/node
$ sudo rm -rf /usr/local/lib/node
Step 3: Open a new terminal and install node

$ brew install node

猜你喜欢

转载自wajmy.iteye.com/blog/2386188
今日推荐