Open jonbondani opened 4 years ago
Same issue here.
Same issue here on macOS X High Sierra (Node.js, yarn up to date):
error /Users/Arnaud/DeĢveloppement/78 North/performance-center/apps/node_modules/weak-napi: Command failed.
Exit code: 1
Command: node-gyp rebuild
Arguments:
Directory: /Users/Arnaud/DeĢveloppement/78 North/performance-center/apps/node_modules/weak-napi
Output:
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.5
gyp info using node@12.14.1 | darwin | x64
gyp info find Python using Python version 2.7.17 found at "/usr/local/opt/python@2/bin/python2.7"
gyp info spawn /usr/local/opt/python@2/bin/python2.7
gyp info spawn args [
gyp info spawn args '/Users/Arnaud/.nvm/versions/node/v12.14.1/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/Arnaud/DeĢveloppement/78 North/performance-center/apps/node_modules/weak-napi/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/Arnaud/.nvm/versions/node/v12.14.1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/Arnaud/Library/Caches/node-gyp/12.14.1/include/node/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/Arnaud/Library/Caches/node-gyp/12.14.1',
gyp info spawn args '-Dnode_gyp_dir=/Users/Arnaud/.nvm/versions/node/v12.14.1/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=/Users/Arnaud/Library/Caches/node-gyp/12.14.1/<(target_arch)/node.lib',
gyp info spawn args '-Dmodule_root_dir=/Users/Arnaud/DeĢveloppement/78 North/performance-center/apps/node_modules/weak-napi',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CC(target) Release/obj.target/nothing/../node-addon-api/src/nothing.o
LIBTOOL-STATIC Release/nothing.a
CXX(target) Release/obj.target/weakref/src/weakref.o
clang: error: no such file or directory: 'North/performance-center/apps/node_modules/node-addon-api'
make: *** [Release/obj.target/weakref/src/weakref.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/Arnaud/.nvm/versions/node/v12.14.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:223:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 17.7.0
gyp ERR! command "/Users/Arnaud/.nvm/versions/node/v12.14.1/bin/node" "/Users/Arnaud/.nvm/versions/node/v12.14.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Arnaud/DeĢveloppement/78 North/performance-center/apps/node_modules/weak-napi
For folk running into this issue - a potential culprit may be an incompatible python version being invoked by node-gyp rebuild
. This was the case on my machine (macOS Catalina) - python
was pointing to a pyenv installed version of python (3.7.0) which yielded the error shared in this thread. switching to the system installed version (2.7.15 in my case for me) allowed the build to proceed.
Not very ideal, but seems to be an issue with python 2 vs 3. maybe the rebuild
command should be updated to check for the expected python version, and throw a more helpful error when not found? not sure if that's the correct resolution, if one is necessary for this sort of error
Instead of messing with python environments you can simply create a virtual environment and continue.
python3 -m venv localvenv
source ./localvenv/bin/activate
yarn install
for installation of the packages.
Hi, I'm trying to install a nodejs project that uses weak-napi as a dependency of another package. I've tried several node, yarn, python and node-gyp versions, all with the same result:
I've opened an issue in the node-gyp's git as well but I think the problem is related to the weak-napi installation.
Can you help me with this issue, please? Thanks