我正在尝试在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上安装node
和npm
?
答案 0 :(得分:1)
Mac OS X的可用选项:
brew install node
port install nodejs
pkgin -y install nodejs
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 "/"