I'm having issues with getting `npm` to work. I have tried uninstalling and reinstalling nodejs and

I'm having issues with getting
npm
to work. I have tried uninstalling and reinstalling nodejs and npm a good amount of times, with no success. I have installed nodejs and npm from the apt package manager.

I want to install gitmoji a tool for making ⭐pretty⭐ commit messages. I had this on my old machine and I've been wanting to install it. When I run
sudo npm install gitmoji
I get an error along the lines of
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 1
npm ERR! path /home/bert/node_modules/kexec
npm ERR! command failed
npm ERR! command sh -c node-gyp configure build
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack     at PythonFinder.failNoPython (/home/bert/node_modules/node-gyp/lib/configure.js:484:19)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/home/bert/node_modules/node-gyp/lib/configure.js:406:16)
npm ERR! gyp ERR! stack     at F (/home/bert/node_modules/which/which.js:68:16)
npm ERR! gyp ERR! stack     at E (/home/bert/node_modules/which/which.js:80:29)
npm ERR! gyp ERR! stack     at /home/bert/node_modules/which/which.js:89:16
npm ERR! gyp ERR! stack     at /home/bert/node_modules/isexe/index.js:42:5
npm ERR! gyp ERR! stack     at /home/bert/node_modules/isexe/mode.js:8:5
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (fs.js:168:21)
npm ERR! gyp ERR! System Linux 5.15.0-41-generic
npm ERR! gyp ERR! command "/usr/bin/node" "/home/bert/node_modules/.bin/node-gyp" "configure" "build"
npm ERR! gyp ERR! cwd /home/bert/node_modules/kexec
npm ERR! gyp ERR! node -v v12.22.9
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2022-08-01T23_41_52_860Z-debug-0.log
I am using nodejs version v14.15.4 and npm version 8.15.1. Any ideas (also for additional info I am using Ubuntu 22.04LTS)
Was this page helpful?