无法安装npm

时间:2016-01-18 10:57:04

标签: node.js npm

我正在尝试在OSX上安装node,如下所示:

brew install node

但是,我收到以下错误:

Warning: You are using OS X 10.11.
We do not provide support for this pre-release version.
You may encounter build failures or other breakage.
==> Downloading https://nodejs.org/dist/v0.12.7/node-v0.12.7.tar.gz
Already downloaded: /Library/Caches/Homebrew/node-0.12.7.tar.gz
==> ./configure --prefix=/usr/local/Cellar/node/0.12.7 --without-npm --without-s
==> make install
ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [/private/tmp/node20160118-13255-1k2k8lz/node-v0.12.7/out/Release/openssl-cli] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [node] Error 2
Warning: It appears you have MacPorts or Fink installed.
Software installed with other package managers causes known problems for
Homebrew. If a formula fails to build, uninstall MacPorts/Fink and try again.

READ THIS: https://git.io/brew-troubleshooting

Warning: You are using OS X 10.11.
We do not provide support for this pre-release version.

我已卸载macports,但错误仍然存​​在。

如何在Mac上安装nodenpm

1 个答案:

答案 0 :(得分:1)

Mac OS X的可用选项:

cURL并使用bash执行:

curl "https://nodejs.org/dist/latest/node-${VERSION:-$(wget -qO- https://nodejs.org/dist/latest/ | sed -nE 's|.*>node-(.*)\.pkg</a>.*|\1|p')}.pkg" > "$HOME/Downloads/node-latest.pkg" && sudo installer -store -pkg "$HOME/Downloads/node-latest.pkg" -target "/"