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

依然范特西╮ 提交于 2019-12-03 01:07:41

You are trying to run node-gyp rebuild in current working directory (CWD) /usr/local/bin so the node-gyp can not find binding at /usr/local/bin/binding.gyp.

Navigate your terminal to directory which contain nodejs module and only then run node-gyp rebuild.

cd ~/Projects/your-nodejs-native-module/
node-gyp rebuld

BTW I am not sure from which node version exactly but in modern versions you can just run npm install in this directory and npm will run node-gyp rebuild for you.

cd ~/Projects/your-nodejs-native-module/
npm install

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.

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.

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.

ShahNewazKhan

Install node-gyp globally first:

sudo npm -g install node-gyp

Please see this answer

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