我试图像这样在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
? 最佳答案
Mac OS X的可用选项:
下载NodeJS Installer for Mac
Via package manager:
自酿:brew install node
MacPorts:port install nodejs
pkgsrc: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 "/"
关于node.js - 无法安装npm,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/34853001/