node-gyp: Install not working OSX Node 12

➜  bluetooth node-gyp build                          
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.3
gyp info using node@12.6.0 | darwin | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
make: *** No rule to make target `Release/obj.target/BluetoothSerialPort/src/osx/DeviceINQ.o', needed by `Release/BluetoothSerialPort.node'.  Stop.
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/node-gyp/lib/build.js:196:23)
gyp ERR! stack     at ChildProcess.emit (events.js:203:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.6.0
gyp ERR! command "/usr/local/Cellar/node/12.6.0/bin/node" "/usr/local/bin/node-gyp" "build"
gyp ERR! cwd /Development/Node/bluetooth
gyp ERR! node -v v12.6.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok 
➜  bluetooth 

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 3
  • Comments: 16 (5 by maintainers)

Most upvoted comments

Downgrading node from 12 to 10 to install a package is not a solution, rather a workaround.

This seems to have been resolved? Closing then.

Probably unreliable information, but for windows users with Node v. 12.X downgrade may help. I switched to node v. 10.16.3 and it works:

> nvm list
    12.10.0
  * 10.16.3 (Currently using 64-bit executable)

All steps:

npm install --global --production windows-build-tools@4.0.0
rimraf node_modules
yarn cache clean
nvm use 10.16.3
yarn

Those errors (where there’s a clear mismatch between a C++ API call and the API it’s trying to compile against) indicate a mismatch between the C++ code of the addon being compiled and the exported C++ API of Node.js (usually V8 itself).

You reconcile these by making sure that the addon you’re compiling supports the version of Node.js you’re running. Usually either downgrading your Node.js version to a supported one, or using a newer version of the addon that supports the version of Node.js you’re running. There’s also a stable API/ABI project for Node.js these days that solves most of those problems, but it requires the addon author to migrate their code to it, which isn’t a small amount of effort but you could request they have a look at it at least. https://github.com/nodejs/node-addon-api

Happened to me as well