Search code examples
reactjsnpm-installbuild-error

npm ERR! code 1.Why this error massage gonna happen npm ERR! code 1? How can I fix it


This is error code :

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'reactjs-percentage-circle@1.0.0',  
npm WARN EBADENGINE   required: { node: '>=6.0.0', npm: '~3.3.6' },
npm WARN EBADENGINE   current: { node: 'v15.10.0', npm: '7.16.0' } 
npm WARN EBADENGINE }
npm ERR! code 1
npm ERR! path D:\Buman Project\geniusClone\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /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@15.10.0 | win32 | 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 (D:\Buman Project\geniusClone\node_modules\node-gyp\lib\configure.js:484:19)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (D:\Buman Project\geniusClone\node_modules\node-gyp\lib\configure.js:509:16)npm ERR! gyp ERR! stack     at callback (D:\Buman Project\geniusClone\node_modules\graceful-fs\polyfills.js:299:20)
npm ERR! gyp ERR! stack     at FSReqCallback.oncomplete (node:fs:196:21)
npm ERR! gyp ERR! System Windows_NT 10.0.18363
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "D:\\Buman Project\\geniusClone\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd D:\Buman Project\geniusClone\node_modules\node-sass
npm ERR! gyp ERR! node -v v15.10.0
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!     C:\Users\Zolboo\AppData\Local\npm-cache\_logs\2021-06-06T12_41_51_207Z-debug.log

Solution

  • There are two problems

    1. Is a warning (which can probably ignored) This package requires an npm version ~3.3.6 which means >= 3.3.6 and < 3.4 ie, every 3.3.x where x >= 6. You have npm version 7.16. which does not fulfil this requirement. Futhermore,

    2. node-gyp requires a python installation on your system and didn't find any ... See the docs on how to install and configure node-gyp on windows.