Node-gyp: Stuck with `node-gyp rebuild` failing on mac os x

Created on 16 Oct 2015  Â·  20Comments  Â·  Source: nodejs/node-gyp

└─(17:27:00 on master ✹)──> npm install                                                                                                                              ──(Fri,Oct16)─┘
npm WARN peerDependencies The peer dependency @lukekarrys/jade-runtime@^1.11.1 included from templatizer will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
\
> [email protected] install /Users/nishant.pathak/projects/chatclient-web/node_modules/stanza.io/node_modules/xmpp-jid/node_modules/node-stringprep
> node-gyp rebuild

  SOLINK_MODULE(target) Release/node_stringprep.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_stringprep.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:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/nishant.pathak/projects/chatclient-web/node_modules/stanza.io/node_modules/xmpp-jid/node_modules/node-stringprep
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
\
> [email protected] install /Users/nishant.pathak/projects/chatclient-web/node_modules/jxt/node_modules/ltx/node_modules/node-expat/node_modules/iconv
> node-gyp rebuild

  CC(target) Release/obj.target/libiconv/deps/libiconv/lib/iconv.o
  LIBTOOL-STATIC Release/iconv.a
  CXX(target) Release/obj.target/iconv/src/binding.o
  SOLINK_MODULE(target) Release/iconv.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/iconv.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:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/nishant.pathak/projects/chatclient-web/node_modules/jxt/node_modules/ltx/node_modules/node-expat/node_modules/iconv
gyp ERR! node -v v4.2.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 

> [email protected] install /Users/nishant.pathak/projects/chatclient-web/node_modules/gulp-watch/node_modules/chokidar/node_modules/fsevents
> node-pre-gyp install --fallback-to-build

[fsevents] Success: "/Users/nishant.pathak/projects/chatclient-web/node_modules/gulp-watch/node_modules/chokidar/node_modules/fsevents/lib/binding/Release/node-v46-darwin-x64/fse.node" is installed via remote
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.2.1
npm ERR! npm  v2.14.7
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the node-stringprep package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls node-stringprep
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/nishant.pathak/projects/chatclient-web/npm-debug.log
macOS

Most helpful comment

Per this issue, I was able to resolve this by entering this temp command:

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

All 20 comments

tried updateding xcode, still no luck.

ld: library not found for -lgcc_s.10.5

@pathakNishant can you make sure you download the Xcode CLI tools from Apple's website? Something like: http://osxdaily.com/2014/02/12/install-command-line-tools-mac-os-x/

You may also have to do a full software update and a reboot.

I'm suffering the same issues on El Cap with new Xcode 7 (and Command Line Tools) installed.

The rebuild errors are occurring specifically with packages [email protected] & [email protected] in my case with Exit status 1

EDIT: After looking into this further, is it an issue of packages listing old versions for dependancies (see bufferutil) now that io.js has been merged with node?

xcode-select is already install.
xcode-select version 2339.

Per this issue, I was able to resolve this by entering this temp command:

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

@Kollibri great, it works. Thanks

@Kollibri Thanks

@Kollibri commented on Oct 21, 2015, 6:06 PM GMT+2:

Per this issue, I was able to resolve this by entering this temp command:

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

Worked great, thanks.

@Kollibri Thank you so much! This saved me so much time.

thanks also ! saved my day

@Kollibri Thank you!!!

@Kollibri Thank you! XCode once again poking a finger in my eye. ;-)

@Kollibri That's magic.

@Kollibri +1. Thank you!

For me, this problem was solved by switching from python3 to legacy python2.7

To run both of them in sequence
cd /usr/local/lib && sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib

From: https://github.com/yarnpkg/yarn/issues/5962#issuecomment-491934806

This is what worked for me:

// package.json
{
  "resolutions": {
    "**/**/fsevents": "^1.2.9"
  }
}

@Kollibri Thanks, workd for me.

Was this page helpful?
0 / 5 - 0 ratings