When i run the the command the node-gyp rebuild
command I get the following error:
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | linux | x64
gyp info find Python using Python version 3.8.5 found at "/usr/bin/python3"
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: ENOENT: no such file or directory, mkdir '/home/rando/.cache/node-gyp/9.6.1'
gyp ERR! System Linux 5.8.0-45-generic
gyp ERR! command "/home/rando/.nvm/versions/node/v9.6.1/bin/node" "/home/rando/.nvm/versions/node/v9.6.1/bin/node-gyp" "rebuild" "--python=/home/rando/.pyenv/versions/2.7.18/bin"
gyp ERR! cwd /home/rando/Desktop/git/master-node/node/browser_engines/src/browsers/webkit
gyp ERR! node -v v9.6.1
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok
I have tried to change the node-gyp default python version like below:
node-gyp rebuild --python=/home/rando/.pyenv/versions/2.7.18/bin
node-gyp rebuild --python=2.7
node-gyp rebuild --python=2.7.18
And all comand resulted with the same Error. They are using python3 instead of python passed to configuration.
Environments Details
I solved this issue by exporting the NODE_GYP_FORCE_PYTHON
like below:
export NODE_GYP_FORCE_PYTHON=$HOME/.pyenv/versions/2.7.18/bin/python
echo $NODE_GYP_FORCE_PYTHON