Home > database >  Fail to install node modules because of node-gyp
Fail to install node modules because of node-gyp

Time:09-24

I am trying "npm install" and the installation is not finished for the error below..

npm ERR! code 1
npm ERR! path C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\node-sass
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node scripts/build.js
npm ERR! Building: C:\Program Files\nodejs\node.exe C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\node-gyp\bin\node-gyp.js rebuild --verbose --libsass_ext= --libsass_cflags= --libsass_ldflags= --libsass_library=
npm ERR! gyp info using node-gyp@3.8.0
npm ERR! gyp info using node@15.14.0 | win32 | x64
npm ERR! gyp verb command rebuild []
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp verb command configure []
npm ERR! gyp verb check python checking for Python executable "python2.7" in the PATH
npm ERR! gyp verb `which` failed Error: not found: python2.7
npm ERR! gyp verb `which` failed     at getNotFoundError (C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:193:21)
npm ERR! gyp verb `which` failed  python2.7 Error: not found: python2.7
npm ERR! gyp verb `which` failed     at getNotFoundError (C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\which\which.js:13:12)
npm ERR! gyp verb `which` failed     at F (C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\which\which.js:68:19)
npm ERR! gyp verb `which` failed     at E (C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\which\which.js:80:29)
npm ERR! gyp verb `which` failed     at C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\which\which.js:89:16
npm ERR! gyp verb `which` failed     at C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\isexe\index.js:42:5
npm ERR! gyp verb `which` failed     at C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\isexe\windows.js:36:5
npm ERR! gyp verb `which` failed     at FSReqCallback.oncomplete (node:fs:193:21) {
npm ERR! gyp verb `which` failed   code: 'ENOENT'
npm ERR! gyp verb `which` failed }
npm ERR! gyp verb could not find "python2.7". checking python launcher
npm ERR! gyp verb build type Release
npm ERR! gyp verb architecture x64
npm ERR! gyp verb node dev dir C:\Users\BASILIS\.node-gyp\15.14.0
npm ERR! gyp verb found first Solution file build/binding.sln
npm ERR! gyp verb could not find "msbuild.exe" in PATH - finding location in registry
npm ERR! gyp info spawn C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'build/binding.sln',
npm ERR! gyp info spawn args   '/nologo',
npm ERR! gyp info spawn args   '/p:Configuration=Release;Platform=x64'
npm ERR! gyp info spawn args ]
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onExit (C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\node-gyp\lib\build.js:262:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:369:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19043
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\BASILIS\\Desktop\\kronos-webapp\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
npm ERR! gyp ERR! cwd C:\Users\BASILIS\Desktop\kronos-webapp\node_modules\node-sass
npm ERR! gyp ERR! node -v v15.14.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed with error code: 1

I tried to first install the version of [email protected] but is not changed anything I tried to install the current version and i take the same problem as before.

Thanks in advance

CodePudding user response:

You should install python2.7 to your os

CodePudding user response:

ok problem was fixed with 2 following commands

npm config set msvs_version 2015global

npm config set python python2.7
  • Related