I have run command yarn install but an error was found there

Gravatar
luhut sihombing

I have run command yarn install but an error was found there, the error is as follows.

gyp verb check python checking for Python executable "python2" in the PATH gyp verb which failed Error: not found: python2 gyp verb which failed at getNotFoundError (D:\codeartaapp-react\nodemodules\which\which.js:13:12) gyp verb which failed at F (D:\codeartaapp-react\nodemodules\which\which.js:68:19) gyp verb which failed at E (D:\codeartaapp-react\nodemodules\which\which.js:80:29) gyp verb which failed at D:\codeartaapp-react\nodemodules\which\which.js:89:16 gyp verb which failed at D:\codeartaapp-react\nodemodules\isexe\index.js:42:5 gyp verb which failed at D:\codeartaapp-react\nodemodules\isexe\windows.js:36:5 gyp verb which failed at FSReqCallback.oncomplete (fs.js:183:21) gyp verb which failed python2 Error: not found: python2

Gravatar
Michael Daineka

Thanks for your question! Please, try to run the following commands:

  • delete node_modules folder
  • running npm install --global windows-build-tools
  • reinstalling node modules or node-sass with npm install

Please let us know if this helps!

Gravatar
luhut sihombing

already run command above and success and then run yarn install, but found error like this

gyp verb could not find "python". checking python launcher gyp verb could not find "python". guessing location gyp verb ensuring that file exists: C:\Python27\python.exe

gyp verb which failed at getNotFoundError (D:\flatlogic\FE\nodemodules\which\which.js:13:12) gyp verb which failed at F (D:\flatlogic\FE\nodemodules\which\which.js:68:19) gyp verb which failed at E (D:\flatlogic\FE\nodemodules\which\which.js:80:29) gyp verb which failed at D:\flatlogic\FE\nodemodules\which\which.js:89:16 gyp verb which failed at D:\flatlogic\FE\nodemodules\isexe\index.js:42:5 gyp verb which failed at D:\flatlogic\FE\nodemodules\isexe\windows.js:36:5 gyp verb which failed at FSReqCallback.oncomplete (fs.js:183:21) { gyp verb which failed code: 'ENOENT' gyp verb which failed } gyp verb could not find "python". checking python launcher gyp verb could not find "python". guessing location gyp verb ensuring that file exists: C:\Python27\python.exe gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable. gyp ERR! stack at PythonFinder.failNoPython (D:\flatlogic\FE\nodemodules\node-gyp\lib\configure.js:484:19) gyp ERR! stack at PythonFinder. (D:\flatlogic\FE\nodemodules\node-gyp\lib\configure.js:509:16) gyp ERR! stack at callback (D:\flatlogic\FE\nodemodules\graceful-fs\polyfills.js:299:20) gyp ERR! stack at FSReqCallback.oncomplete (fs.js:183:21) gyp ERR! System WindowsNT 10.0.18363 gyp ERR! command "C:\Program Files\nodejs\node.exe" "D:\flatlogic\FE\nodemodules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsassext=" "--libsasscflags=" "--libsassldflags=" "--libsasslibrary=" gyp ERR! cwd D:\flatlogic\FE\nodemodules\node-sass gyp ERR! node -v v14.15.2 gyp ERR! node-gyp -v v3.8.0 gyp ERR! not ok

Gravatar
Michael Daineka

please try following:

  • delete node_modules

  • delete package-lock.json

  • sudo npm install node-sass --unsafe-perm=true --allow-root

  • sudo npm install node-sass-middleware --unsafe-perm=true --allow-root

It causes because node js compatibility with the current version of node-sass installed. Also can you please provide nodejs version you have

Thanks

Gravatar
luhut sihombing

by the way why use python

Gravatar
Michael Daineka

Python is required by the modules we use

Gravatar

if deploy to server production , whether it should be install Python in the server production ?

Gravatar

It depends on node_modules package.json file, if it includes Python in devDependencies it won't.

Gravatar

on this case project SING APP REACT, how is it ?

Cookie Consent

By continuing to browse or by clicking 'OK', you agree to the storing of cookies on your device to enhance your site experience and for analytical purposes. To learn more about how we use cookies, please see our cookies policy.