NPM: The “ld: library not found for -lgcc_s.10.5” on On OS X El Capitan?

≯℡__Kan透↙ 提交于 2020-01-30 16:15:26

问题


When I use npm install to install dependencies of this repository, I encountered an error like this:

> 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

However, the installation is still finished successfully. And when I use npm run, the app still works well. Does anyone have ideas about what node-gyp rebuild does here? And why the project works well even node-gyp throws error here?


回答1:


I ran into this problem after upgrading to Node 4.1.0 (OS X 10.10.5) and didn't have any luck after reinstalling from the official package. For what it's worth, this solved it for me:

cd /usr/local/lib
sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib

(Originally found here.)




回答2:


It is solved after I reinstalled node.js from the official pkg.




回答3:


I also had this problem. Turns out I had upgraded Xcode but never rebooted. After reboot I was able to npm install successfully.



来源:https://stackoverflow.com/questions/31936170/npm-the-ld-library-not-found-for-lgcc-s-10-5-on-on-os-x-el-capitan

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!