Tuesday, January 12, 2021

Node-GYP Failed With Python3 on Yarn Install

I was trying to set up an old development environment for a rails application on Fedora 33 but installing node dependency modules via yarn install failed with the message below.

gyp ERR! stack Error: Command failed: /usr/bin/python3

Since python3 is installed by default, the print command with python2 syntax was raising an error.

For a quick fix, I installed python2 via 'dnf install python2' and configured npm to use that version. 

# npm config set python /usr/bin/python2

After that, yarn install succeeded.

I read there is another way, which is to update to a newer node-gyp version, but that might require an upgrade of other dependencies I'm not familiar with.

No comments:

Post a Comment

SSH : No matching host key type found. Their offer: ssh-rsa,ssh-dss

Got this while connecting to my mikrotik router via ssh   Unable to negotiate with <ip address> port <ssh port>: no matching hos...