question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

node-gyp rebuild Fail on osx with Xcode V 7.2.1

See original GitHub issue

I have a problem with node-gyp rebuild Now I’m using xcode Version 7.2.1 (7C1002) and when I install the library like libxmljs@0.14.3 I have this error

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.3.0
gyp ERR! command "node" "/Users/bob/.nvm/versions/node/v0.12.6/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd my-path/node_modules/gulp-xml-editor/node_modules/libxmljs
gyp ERR! node -v v0.12.6
gyp ERR! node-gyp -v v2.0.1
gyp ERR! not ok
npm ERR! Darwin 15.3.0
npm ERR! argv "/Users/bob/.nvm/versions/node/v0.12.6/bin/node" "/Users/bob/.nvm/versions/node/v0.12.6/bin/npm" "install"
npm ERR! node v0.12.6
npm ERR! npm  v2.11.2
npm ERR! code ELIFECYCLE

npm ERR! libxmljs@0.14.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the libxmljs@0.14.3 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the libxmljs 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 libxmljs
npm ERR! There is likely additional logging output above.

I tried with NVM with this node version

nvm 0.12.6 | nvm 0.12.7

But I have the same Problem

With command `node-gyp rebuild``

I have this output

gyp info it worked if it ends with ok
gyp info using node-gyp@3.2.1
gyp info using node@0.12.7 | darwin | x64
gyp info spawn /Applications/MAMP/Library/bin/python2
gyp info spawn args [ '/usr/local/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/my-path/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/usr/local/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/bob/.node-gyp/0.12.7/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/bob/.node-gyp/0.12.7',
gyp info spawn args   '-Dnode_gyp_dir=/usr/local/lib/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=node.lib',
gyp info spawn args   '-Dmodule_root_dir=/my-path',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.' ]
gyp: binding.gyp not found (cwd: my-path) while trying to load binding.gyp  
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/lib/node_modules/node-gyp/lib/configure.js:305:16)
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.3.0
gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd my-path
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:23 (5 by maintainers)

github_iconTop GitHub Comments

11reactions
trevorrjohncommented, Mar 4, 2016

has anyone gotten another solution for this. I have tried removing my node_modules folder like @wnordmann said, but still had the same issue.

3reactions
erdinccommented, Apr 4, 2016

I’m using nvm and I solved this issue by cd ~/.nvm/versions/node/v5.5.0/lib/node_modules/npm (change v5.5.0 with your node version.) run npm install

Read more comments on GitHub >

github_iconTop Results From Across the Web

node-gyp rebuild Fail on Mac OSX El Capitan - Stack Overflow
I have a problem with node-gyp rebuild Now I'm using xcode Version 7.2.1 (7C1002) and when I install the library like libxmljs@0.14.3 I...
Read more >
Fix broken 'node-gyp' issue for Mac OS | by Fernando De Freitas
Another usual fix is to reinstall XCode's command-line tools with: ... Why is node-gyp rebuild failing on Mac OSX El Capitan — Stack...
Read more >
How to Handle Node-Gyp Rebuild Failing on Mac
How to Handle Node-Gyp Rebuild Failing on Mac ; Start Xcode on your Mac. · Under the General panel, click on Downloads. ;...
Read more >
Npm install errors - M220JS - MongoDB
npm ERR! npm ERR! Failed at the weak-napi@1.0.3 install script 'node-gyp rebuild'. npm ERR! Make sure you have the latest version of node.js...
Read more >
env python no such file or directory node-gyp - You.com
`npm install` fails on node-gyp rebuild with `env: python: No such file or directory` on mac pro m1. Post author By user user;...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found