NPM:On OS X El Capitan上的"ld:找不到-lgcc_s.10.5的库"?

Han*_*Sun 19 macos node.js npm node-gyp

当我npm install用来安装这个存储库的依赖项时,我遇到了这样的错误:

> fsevents@0.3.8 install /Users/hanfeisun/Workspace/vue-webpack-example/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents
> node-gyp rebuild

  SOLINK_MODULE(target) Release/.node
ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/.node] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 15.0.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/hanfeisun/Workspace/vue-webpack-example/node_modules/webpack/node_modules/watchpack/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok 
npm WARN optional dep failed, continuing fsevents@0.3.8
Run Code Online (Sandbox Code Playgroud)

但是,安装仍然成功完成.当我使用时npm run,该应用仍然运作良好.有谁有关于node-gyp rebuild这里做什么的想法?为什么项目运作良好甚至node-gyp引发错误?

Sam*_*ine 61

我升级到Node 4.1.0(OS X 10.10.5)后遇到了这个问题,从官方软件包重新安装后没有任何运气.为了它的价值,这为我解决了它:

cd /usr/local/lib
sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib
Run Code Online (Sandbox Code Playgroud)

(最初在这里找到.)

  • 只是想说明这解决了我的问题.谢谢!! (3认同)

Han*_*Sun 1

我从官方pkg重新安装node.js后解决了。