0

Im getting these errors while doing npm install ,node v16.18

npm ERR! code 1
npm ERR! path /home/shammirbaig/Gitlab_LR_Frontend/admin-console-frontend/node_modules/lwip
npm ERR! command failed
npm ERR! command sh -c -- node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@16.18.1 | linux | x64
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Can't find Python executable "/usr/lib/python2.7", you can set the PYTHON env variable.
npm ERR! gyp ERR! stack     at PythonFinder.failNoPython (/home/shammirbaig/Gitlab_LR_Frontend/admin-console-frontend/node_modules/node-gyp/lib/configure.js:484:19)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/home/shammirbaig/Gitlab_LR_Frontend/admin-console-frontend/node_modules/node-gyp/lib/configure.js:406:16)
npm ERR! gyp ERR! stack     at F (/home/shammirbaig/Gitlab_LR_Frontend/admin-console-frontend/node_modules/which/which.js:68:16)
npm ERR! gyp ERR! stack     at E (/home/shammirbaig/Gitlab_LR_Frontend/admin-console-frontend/node_modules/which/which.js:80:29)
npm ERR! gyp ERR! stack     at /home/shammirbaig/Gitlab_LR_Frontend/admin-console-frontend/node_modules/which/which.js:89:16
npm ERR! gyp ERR! stack     at /home/shammirbaig/Gitlab_LR_Frontend/admin-console-frontend/node_modules/isexe/index.js:42:5
npm ERR! gyp ERR! stack     at /home/shammirbaig/Gitlab_LR_Frontend/admin-console-frontend/node_modules/isexe/mode.js:8:5
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:203:5)
npm ERR! gyp ERR! System Linux 5.15.0-53-generic
npm ERR! gyp ERR! command "/home/shammirbaig/.nvm/versions/node/v16.18.1/bin/node" "/home/shammirbaig/Gitlab_LR_Frontend/admin-console-frontend/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /home/shammirbaig/Gitlab_LR_Frontend/admin-console-frontend/node_modules/lwip
npm ERR! gyp ERR! node -v v16.18.1
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok

I am doing npm install and getting these errors. Cant figure out what is really going on or what am I really missing here. I tried manually installing node-gyp . Totally frustrating

1 Answers1

0

You need to install Python.

Download Python

Beardificent
  • 71
  • 1
  • 5
  • Actually python 3 is installed in my machine – Shammir baig Dec 01 '22 at 05:31
  • i found this on stackoverflow, could be useful. https://stackoverflow.com/questions/69106485/wls2-ubuntu-npm-err-gyp-err-stack-error-cant-find-python-executable-python I have only encountered your error on a new machine without python installed on it. Installing it fixed this error. – Beardificent Dec 01 '22 at 13:44