nodejs / node-gyp

Node.js native addon build tool
MIT License
9.97k stars 1.8k forks source link

NPM error code :7 #3092

Open zacoje opened 1 week ago

zacoje commented 1 week ago

Good morning, I am attempting to use NPM install and I am getting the following error message consistently I have been looking around for similar issues but none of their fixes seem to work in my case and help would be great thank you!

npm error Debugger attached. npm error gyp info it worked if it ends with ok npm error gyp verb cli [ npm error gyp verb cli 'C:\Program Files\nodejs\node.exe', npm error gyp verb cli 'E:\VSCODE REPO\TFBIC.Vue.Docnet.Search\node_modules\node-gyp\bin\node-gyp.js', npm error gyp verb cli 'rebuild', npm error gyp verb cli '--verbose', npm error gyp verb cli '--libsass_ext=', npm error gyp verb cli '--libsass_cflags=', npm error gyp verb cli '--libsass_ldflags=', npm error gyp verb cli '--libsass_library=' npm error gyp verb cli ] npm error gyp info using node-gyp@7.1.2 npm error gyp info using node@22.11.0 | win32 | x64 npm error gyp verb command rebuild [] npm error gyp verb command clean [] npm error gyp verb clean removing "build" directory npm error gyp verb command configure [] npm error gyp verb find Python Python is not set from command line or npm configuration npm error gyp verb find Python Python is not set from environment variable PYTHON npm error gyp verb find Python checking if "python3" can be used npm error gyp verb find Python - executing "python3" to get executable path npm error (node:9436) [DEP0060] DeprecationWarning: The util._extend API is deprecated. Please use Object.assign() instead. npm error (Use node --trace-deprecation ... to show where the warning was created) npm error gyp verb find Python - "python3" is not in PATH or produced an error npm error gyp verb find Python checking if "python" can be used npm error gyp verb find Python - executing "python" to get executable path npm error gyp verb find Python - "python" is not in PATH or produced an error npm error gyp verb find Python checking if "python2" can be used npm error gyp verb find Python - executing "python2" to get executable path npm error gyp verb find Python - "python2" is not in PATH or produced an error npm error gyp verb find Python checking if Python is C:\Python37\python.exe npm error gyp verb find Python - executing "C:\Python37\python.exe" to get version npm error gyp verb find Python - "C:\Python37\python.exe" could not be run npm error gyp verb find Python checking if Python is C:\Python27\python.exe npm error gyp verb find Python - executing "C:\Python27\python.exe" to get version npm error gyp verb find Python - "C:\Python27\python.exe" could not be run npm error gyp verb find Python checking if the py launcher can be used to find Python npm error gyp verb find Python - executing "py.exe" to get Python executable path npm error gyp verb find Python - executable path is "C:\Users\USER\AppData\Local\Programs\Python\Python313\python.exe" npm error gyp verb find Python - executing "C:\Users\USER\AppData\Local\Programs\Python\Python313\python.exe" to get version npm error gyp verb find Python - version is "3.13.0" npm error gyp info find Python using Python version 3.13.0 found at "C:\Users\USER\AppData\Local\Programs\Python\Python313\python.exe" npm error gyp verb get node dir no --target version specified, falling back to host node version: 22.11.0 npm error gyp verb command install [ '22.11.0' ] npm error gyp verb install input version string "22.11.0" npm error gyp verb install installing version: 22.11.0 npm error gyp verb install --ensure was passed, so won't reinstall if already installed npm error (node:9436) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. npm error gyp verb install version is already installed, need to check "installVersion" npm error gyp verb got "installVersion" 11 npm error gyp verb needs "installVersion" 9 npm error gyp verb install version is good npm error gyp verb get node dir target node version installed: 22.11.0 npm error gyp verb build dir attempting to create "build" dir: E:\VSCODE REPO\TFBIC.Vue.Docnet.Search\node_modules\node-sass\build npm error gyp verb build dir "build" dir needed to be created? \?\E:\VSCODE REPO\TFBIC.Vue.Docnet.Search\node_modules\node-sass\build npm error gyp verb find VS msvs_version not set from command line or npm config npm error gyp verb find VS VCINSTALLDIR not set, not running in VS Command Prompt npm error gyp verb find VS unknown version "undefined" found at "E:\VS2022" npm error gyp verb find VS checking VS2019 (16.11.33927.289) found at: npm error gyp verb find VS "E:\Program Files (x86)\Microsoft Visual Studio\2019" npm error gyp verb find VS - found "Visual Studio C++ core features" npm error gyp verb find VS - found VC++ toolset: v142 npm error gyp verb find VS - found Windows SDK: 10.0.19041.0 npm error gyp info find VS using VS2019 (16.11.33927.289) found at: npm error gyp info find VS "E:\Program Files (x86)\Microsoft Visual Studio\2019" npm error gyp info find VS run with --verbose for detailed information npm error gyp verb build/config.gypi creating config file npm error gyp ERR! UNCAUGHT EXCEPTION npm error gyp ERR! stack TypeError: Cannot assign to read only property 'cflags' of object '#' npm error gyp ERR! stack at createConfigFile (E:\VSCODE REPO\TFBIC.Vue.Docnet.Search\node_modules\node-gyp\lib\configure.js:117:21) npm error gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:85:11) npm error gyp ERR! System Windows_NT 10.0.19045 npm error gyp ERR! command "C:\Program Files\nodejs\node.exe" "E:\VSCODE REPO\TFBIC.Vue.Docnet.Search\node_modules\node-gyp\bin\node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library=" npm error gyp ERR! cwd E:\VSCODE REPO\TFBIC.Vue.Docnet.Search\node_modules\node-sass npm error gyp ERR! node -v v22.11.0 npm error gyp ERR! node-gyp -v v7.1.2 npm error gyp ERR! Node-gyp failed to build your package. npm error gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author. npm error Waiting for the debugger to disconnect... npm error Build failed with error code: 7 npm error Waiting for the debugger to disconnect... npm error A complete log of this run can be found in: C:\Users\USER\AppData\Local\npm-cache_logs\2024-11-12T16_28_51_906Z-debug-0.log Waiting for the debugger to disconnect..

I tried to rebuild gyp and it gives me this error bellow

gyp ERR! configure error gyp ERR! stack Error: gyp failed with exit code: 1 gyp ERR! stack at ChildProcess. (C:\Users\USER\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:317:18) gyp ERR! stack at ChildProcess.emit (node:events:518:28) gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12) gyp ERR! System Windows_NT 10.0.19045 gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\USER\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild" gyp ERR! cwd E:\VSCODE REPO\TFBIC.Vue.Docnet.Search gyp ERR! node -v v22.11.0 gyp ERR! node-gyp -v v10.2.0 gyp ERR! not ok

cclauss commented 1 week ago

The description above does not explain what command was typed.

npm error gyp info using node-gyp@7.1.2

The text you deleted when creating this issue explained how to fix this problem.

npm error gyp verb find Python - version is "3.13.0"

Python >= v3.12 requires node-gpy >= v10