Why is node-gyp rebuild failing on Mac OSX El Capitan

后端 未结 8 2109
囚心锁ツ
囚心锁ツ 2020-12-30 22:50

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 dur

相关标签:
8条回答
  • 2020-12-30 23:38

    Same issue I had after upgrading macOS

    Update brew

    brew update
    

    Update X-Code

    xcode-select --install
    

    If needed, you may have to reset the path to X-Code

    xcode-select --switch /Applications/Xcode.app
    xcode-select --switch /Library/Developer/CommandLineTools
    
    0 讨论(0)
  • 2020-12-30 23:41

    If you are using virtualenv for your python, you need to deactivate it or point npm to use the OS's own python 2 installation for node-gyp to work.


    EDIT:

    Had another encounter with the same bug a few days ago. This time around node-gyp was not at fault. Apparently the module I was installing has a dependency on a very old version of node-gyp (v1), independent of the system's version (v3.8), which my version of node (v10) no longer supports. Since I did not need that module anymore, I removed it. Alternatively, you may wish to upgrade/downgrade/replace the offending module, or upgrade/downgrade your node. For the OP's case, the offending module was bcrypt@0.8.5.

    0 讨论(0)
提交回复
热议问题