TAGS :Viewed: 13 - Published at: a few seconds ago

[ when trying to configure or rebuild node-gyp, getting errors: mac osx mavericks ]

I think I am not in the correct directory, but I am not sure what directory I should be in to run node-gyp configure?

I get the following errors:

gyp: binding.gyp not found (cwd: /usr/local/bin)
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:337:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 13.0.0
gyp ERR! command "node" "/usr/local/bin/node-gyp" "configure"
gyp ERR! cwd /usr/local/bin
gyp ERR! node -v v0.10.20
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok 

Answer 1

if in doubt first re-install npm install -g node-gyp.

It's best practice to run node-gyp rebuild. Run it from your project's root. Also your binding.gyp should be in the root, pointing to dependencies (somewhere else).

In general there shouldn't be any need to run node-gyp configure manually.

Answer 2

By the look of the things (not 100% sure) /usr/local/bin does not exist in your computer. But it is hard to say from the stack-trace.

Answer 3

I have had this problem with newer versions of node. My best work around has been using something like node version manager (nvm) to revert back to an older version of node and then running npm install again.