I recently bought a mac, which uses Mac OSX El Capitan v10.11.4. Installed node with homebrew, and am using node v6.2.2 and npm v3.9.5. I'm getting an error with bcrypt during npm install
, which I believe derives from a node-gyp rebuild
error. I also recently downloaded xcode-select(version 2343) and xcode(7.3.1) (in that order).
Here is the full error output after i run npm install
:
https://gist.github.com/varunjayaraman/5734af617d616437cd5b3456b20bc503
Not sure what's going wrong. I come from linux land and do tend to be wary of not installing from source myself, so maybe that is the cause of these issues? Anyway, any advice would be super appreciated. I also saw this error springing up for others, but none of their solutions seemed to work (when i type xcode-select --print-path
, I get /Applications/Xcode.app/Contents/Developer
)
If the most complex node-gyp -related dependency you have in your project is something common like node-sass then this is usually the fix you need. Open the file, find the MACOSX_DEPLOYMENT_TARGET key value and replace it with your current Mac OS version ( 10.15. 3 for Catalina for example).
node-gyp is a tool that enables the compilation of native add-on modules for Node in multiple platforms. It has widespread use and is included as a dependency in many NPM packages. On most systems, this isn't an issue, and installing node-gyp with the rest of your packages works as expected.
The binding.gyp file A binding.gyp file describes the configuration to build your module, in a JSON-like format. This file gets placed in the root of your package, alongside package.json .
node-pre-gyp makes it easy to publish and install Node. js C++ addons from binaries. node-pre-gyp stands between npm and node-gyp and offers a cross-platform method of binary deployment.
Anytime i upgrade OSX to newer version, I get the same issue. Here is how i solve it every time:
sudo rm -rf /Library/Developer/CommandLineTools xcode-select --install
That's it. Now next time you do npm install or yarn it'll work.
PS: Sometimes you won't be able to install the command line tool through Xcode-select, for example if you are on beta. In that case, you should be able to install it manually from here: https://developer.apple.com/download/more/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With