I was installing the packages on a NodeJS backend. Then I run into an error which was the following:
gyp.js" rebuild gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT HON env variable.
It said I need some python executable. However when I run:
npm i -force
Everything installs seems to be working fine.
npm i -force
different from a normal npm i
?npm install -s. The -s flag is a shorthand for the silent configuration, which sets the log level of your npm installation process to nothing. The following Terminal commands are all equal: npm install -s npm install --silent npm install --loglevel silent.
A global install will instead put the module into your global package folder (OS dependent), and allows you to run the included executable commands from anywhere. Note that by default you can only require local packages in your code. See the node.
Like Liam has mentioned -force "forces" npm to re-download all packages and install them again. The issue that may arise from that is that obviously if you have too many packages it takes more time to download them each time.
For the specific issue regarding gyp.js as far as I know node-gyp downloads some stuff in the $HOME directory and I assume the path in your case has some spaces. Some tools do not handle spaces in paths which is why it cannot find the executable.
Other possible solutions:
delete the $HOME/.node_gyp folder and run npm update
install the libkrb5-dev package sudo apt-get install libkrb5-dev
install the build-essential package sudo apt-get install build-essential
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