common.gypi not found error in node.js - node.js

I am trying to "node-gyp configure" to try to get the ms sql server driver. However, initially it said binding.gypi was missing or something to that effect. Now however it is saying common.gypi not found. So I created a text document relabelled it as common.gypi and pasted the code from the file common.gypi that I found in the github repository into the file and saved it and closed it and ran "node-gyp configure". This is the output.
D:\Node\SQLServerConnector\node-sqlserver-master>node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp#0.10.6
gyp info using node#0.10.15 | win32 | ia32
gyp info spawn python
gyp info spawn args [ 'C:\Users\Suresh\AppData\Roaming\npm\node_modules\n
ode-gyp\gyp\gyp',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-G',
gyp info spawn args 'msvs_version=auto',
gyp info spawn args '-I',
gyp info spawn args 'D:\Node\SQLServerConnector\node-sqlserver-master\buil
d\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'D:\Node\SQLServerConnector\node-sqlserver-master\comm
on.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Users\Suresh\AppData\Roaming\npm\node_modules\n
ode-gyp\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\Users\Suresh\.node-gyp\0.10.15\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\Users\Suresh\.node-gyp\0.10.15',
gyp info spawn args '-Dmodule_root_dir=D:\Node\SQLServerConnector\node-sqls
erver-master',
gyp info spawn args '--depth=.',
gyp info spawn args '--generator-output',
gyp info spawn args 'D:\Node\SQLServerConnector\node-sqlserver-master\buil
d',
gyp info spawn args '-Goutput_dir=.' ]
gyp: C:\Users\Suresh.node-gyp\0.10.15\common.gypi not found (cwd: D:\Node\SQLSe
rverConnector\node-sqlserver-master) while reading includes of binding.gyp while
trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Users\Suresh\AppData\Roaming\npm
\node_modules\node-gyp\lib\configure.js:424:16)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:
12)
gyp ERR! System Windows_NT 6.1.7600
gyp ERR! command "node" "C:\Users\Suresh\AppData\Roaming\npm\node_modules\
\node-gyp\bin\node-gyp.js" "configure"
gyp ERR! cwd D:\Node\SQLServerConnector\node-sqlserver-master
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok
Please help me resolve this error.

I've had luck with:
rm -rf ~/.node_gyp
cd myAwesomeProject
npm install
npm rebuild
when switching between node 4 and 0.12.4

Seems to be a common issue these days.
You can check https://github.com/TooTallNate/node-gyp/issues/313 and https://github.com/TooTallNate/node-gyp/issues/376 to see if any of these solutions solve your issue.
Particularly, you can:
Remove old dir ~/.node_gyp and run npm install
Copy an older version (ex: ~/.node-gyp/0.10.11/) to the complying path.
Copy the latest version to the complying path.
Chime in this thread to get help.

My solution (on windows) was to go to %appdata%/npm-gypi and delete the folder, after that I could install ganache (which I guess uses gypi as a dependency).
I sure hope this helps someone.. it has been 3 hours of troubleshooting for me..
Edit: Oh and I deleted the npm-cache too

Error encountered on Windows using Node 18.10.0
PS C:\Users\Mike\git\ngp-projects-api> npm rebuild
more information.
npm ERR! code 1
npm ERR! path C:\Users\Mike\git\ngp-projects-api\node_modules\gcstats.js
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#9.1.0
npm ERR! gyp info using node#18.10.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.7 found at "C:\Users\Mike\AppData\Local\Programs\Python\Python39\python.exe"
npm ERR! gyp http GET https://nodejs.org/download/release/v18.10.0/node-v18.10.0-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.10.0/node-v18.10.0-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v18.10.0/SHASUMS256.txt
npm ERR! gyp http GET https://nodejs.org/download/release/v18.10.0/win-x86/node.lib
npm ERR! gyp http GET https://nodejs.org/download/release/v18.10.0/win-x64/node.lib
npm ERR! gyp http GET https://nodejs.org/download/release/v18.10.0/win-arm64/node.lib
npm ERR! gyp http 200 https://nodejs.org/download/release/v18.10.0/SHASUMS256.txt
npm ERR! gyp WARN install got an error, rolling back install
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack FetchError: request to https://nodejs.org/download/release/v18.10.0/win-x86/node.lib failed, reason: connect ETIMEDOUT 2606:4700:10::6814:162e:443
npm ERR! gyp ERR! stack at ClientRequest.<anonymous> (C:\Users\Mike\AppData\Local\nvs\node\18.10.0\x64\node_modules\npm\node_modules\minipass-fetch\lib\index.js:130:14)
npm ERR! gyp ERR! stack at ClientRequest.emit (node:events:513:28)
npm ERR! gyp ERR! stack at TLSSocket.socketErrorListener (node:_http_client:494:9)
npm ERR! gyp ERR! stack at TLSSocket.emit (node:events:525:35)
npm ERR! gyp ERR! stack at emitErrorNT (node:internal/streams/destroy:151:8)
npm ERR! gyp ERR! stack at emitErrorCloseNT (node:internal/streams/destroy:116:3)
npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\\Users\\Mike\\AppData\\Local\\nvs\\node\\18.10.0\\x64\\node.exe" "C:\\Users\\Mike\\AppData\\Local\\nvs\\node\\18.10.0\\x64\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\Mike\git\ngp-projects-api\node_modules\gcstats.js
npm ERR! gyp ERR! node -v v18.10.0
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok
Note: Not specifying --nodedir CLI option
Problem is related to npm using IPv6 address that is timing out inside corporate Intranet
ETIMEDOUT 2606:4700:10::6814:162e:443
Work-around was to copy the entire existing cache directory for Node 18.9.1 to a new cache directory called 18.10.0
e,g,
C:\Users\Mike\AppData\Local\node-gyp\Cache\18.9.1 --> C:\Users\Mike\AppData\Local\node-gyp\Cache\18.10.0
Solution worked for me but doesn't seem kosher
I was fortunate to have an existing cache folder to copy from my old Node installation (Node 18.9.1) before upgrading to Node 18.10.0
Related Node GitHub issue

One line command in powershell:
node "C:\Users\$($env:username)\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" install
The node-gyp.js is in global node_module.

Related

Error while downloading better-sqlite3 in windows

The error I get whenever I try and download better-sqlite3:
npm ERR! code 1
npm ERR! path C:\Windows\System32\node_modules\better-sqlite3
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install || node-gyp rebuild --release
npm ERR! MSBUILD : error MSB1009: Project file does not exist.
npm ERR! Switch: build/binding.sln
npm ERR! prebuild-install warn install No prebuilt binaries found (target=17.8.0 runtime=node arch=x64 libc= platform=win32)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#9.0.0
npm ERR! gyp info using node#17.8.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.8 found at "C:\Users\jagri\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe"
npm ERR! gyp info find VS using VS2019 (16.11.33027.164) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Users\jagri\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Windows\\System32\\node_modules\\better-sqlite3\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\jagri\\AppData\\Local\\node-gyp\\Cache\\17.8.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\jagri\\AppData\\Local\\node-gyp\\Cache\\17.8.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\jagri\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\17.8.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\Windows\\System32\\node_modules\\better-sqlite3',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'C:\\Windows\\System32\\node_modules\\better-sqlite3\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'build/binding.sln',
npm ERR! gyp info spawn args '/clp:Verbosity=minimal',
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:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:527:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22621
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
npm ERR! gyp ERR! cwd C:\Windows\System32\node_modules\better-sqlite3
npm ERR! gyp ERR! node -v v17.8.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok
I found many solutions on stackoverflow as well as github. I tried all of them however it didnt work. I have downloaded node-gyp as well.
Inform me if extra info is needed. Hope you can help

Node-RED npm gyp fails node installation with exit code 1

I'm trying to install a Node-RED node from npm on my Raspberry pi.
However, unlike any other library/node, my installation fails using both npm from termina and the palette UI. I've tried this as root with no difference to the outcome.
The npm install command produces this:
npm ERR! code 1
npm ERR! path /home/pi/.node-red/node_modules/speaker
npm ERR! command failed
npm ERR! command sh /tmp/install-f29e4b28.sh
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#9.0.0
npm ERR! gyp info using node#16.17.1 | linux | arm64
npm ERR! gyp info find Python using Python version 3.9.2 found at "/usr/bin/python3"
npm ERR! gyp WARN EACCES current user ("pi") does not have permission to access the dev dir "/root/.cache/node-gyp/16.17.1"
npm ERR! gyp WARN EACCES attempting to reinstall using temporary dev dir "/tmp/.node-gyp"
npm ERR! gyp http GET https://nodejs.org/download/release/v16.17.1/node-v16.17.1-headers.tar.gz
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.17.1/node-v16.17.1-headers.tar.gz
npm ERR! gyp http GET https://nodejs.org/download/release/v16.17.1/SHASUMS256.txt
npm ERR! gyp http 200 https://nodejs.org/download/release/v16.17.1/SHASUMS256.txt
npm ERR! gyp info spawn /usr/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'make',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/home/pi/.node-red/node_modules/speaker/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/usr/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/tmp/.node-gyp/16.17.1/include/node/common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=/tmp/.node-gyp/16.17.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/tmp/.node-gyp/16.17.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/pi/.node-red/node_modules/speaker',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: name 'mpg123_cpu' is not defined while evaluating condition 'mpg123_cpu=="arm_nofpu"' in deps/mpg123/mpg123.gyp while loading dependencies of binding.gyp while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:261:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Linux 5.15.72-v8+
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /home/pi/.node-red/node_modules/speaker
npm ERR! gyp ERR! node -v v16.17.1
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok
I've tried with the parameters:
unsafe-perm=true
and
omit=dev
I've also tried downgrading my npm version and also purging the package-lock.json files. I've also tried reinstalling gyp to no avail.

Can't install a redis driver

I really wanted to install a fast redis driver for my app, so I decided to use redis-fast-driver, but I can't install it from npm. Everytime I run the command:
npm install redis-fast-driver --save
I get this message:
C:\Users\Michal\Desktop\projekty\steam_user>npm install redis-fast-driver
npm ERR! code 1
npm ERR! path C:\Users\Michal\Desktop\projekty\steam_user\node_modules\redis-fast-driver
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-gyp rebuild
npm ERR! Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
npm ERR! hiredis.c
npm ERR! C:\Users\Michal\Desktop\projekty\steam_user\node_modules\redis-fast-driver\deps\hiredis\hiredis.c(37,10): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory [C:\Users\Michal\Desktop\projekty\steam_user\node_modules\redis-fast-driver\build\deps\hiredis.vcxproj]
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#9.1.0
npm ERR! gyp info using node#16.17.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.6 found at "C:\Python310\python.exe"
npm ERR! gyp info find VS using VS2022 (17.3.32825.248) found at:
npm ERR! gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Python310\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\\Users\\Michal\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\Michal\\Desktop\\projekty\\steam_user\\node_modules\\redis-fast-driver\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\Michal\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\Michal\\AppData\\Local\\node-gyp\\Cache\\16.17.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\Michal\\AppData\\Local\\node-gyp\\Cache\\16.17.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\Michal\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\Michal\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.17.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\Users\\Michal\\Desktop\\projekty\\steam_user\\node_modules\\redis-fast-driver',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'C:\\Users\\Michal\\Desktop\\projekty\\steam_user\\node_modules\\redis-fast-driver\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'build/binding.sln',
npm ERR! gyp info spawn args '/clp:Verbosity=minimal',
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:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onExit (C:\Users\Michal\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:201:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Michal\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\Michal\Desktop\projekty\steam_user\node_modules\redis-fast-driver
npm ERR! gyp ERR! node -v v16.17.0
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Michal\AppData\Local\npm-cache\_logs\2022-09-05T22_19_53_416Z-debug-0.log
I honestly have no clue what to do. I've tried googling solutions for the errors that pop up, but nothing seems to work.

installing quick.db doesn't work on node version 18.0.0 and npm 8.6.0

i am trying to install quick.db but everytime i do i get an error.
see below:
npm ERR! code 7
npm ERR! path C:\Users\Ismael\OneDrive\Desktop\elysium dashboard\node_modules\better-sqlite3
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c prebuild-install || npm run build-release
npm ERR! > better-sqlite3#7.5.1 build-release
npm ERR! > node-gyp rebuild --release
npm ERR! prebuild-install WARN install No prebuilt binaries found (target=18.0.0 runtime=node arch=x64 libc= platform=win32)
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#9.0.0
npm ERR! gyp info using node#18.0.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.4 found at "C:\Users\Ismael\AppData\Local\Programs\Python\Python310\python.exe"
npm ERR! gyp info find VS using VS2019 (16.11.32126.315) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Users\Ismael\AppData\Local\Programs\Python\Python310\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'D:\\Users\\Ismael\\AppData\\Roaming\\nvm\\v18.0.0\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\Ismael\\OneDrive\\Desktop\\elysium dashboard\\node_modules\\better-sqlite3\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'D:\\Users\\Ismael\\AppData\\Roaming\\nvm\\v18.0.0\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\Ismael\\AppData\\Local\\node-gyp\\Cache\\18.0.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\Ismael\\AppData\\Local\\node-gyp\\Cache\\18.0.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=D:\\Users\\Ismael\\AppData\\Roaming\\nvm\\v18.0.0\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\Ismael\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\18.0.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\Users\\Ismael\\OneDrive\\Desktop\\elysium dashboard\\node_modules\\better-sqlite3',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'C:\\Users\\Ismael\\OneDrive\\Desktop\\elysium dashboard\\node_modules\\better-sqlite3\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'build/binding.sln',
npm ERR! gyp info spawn args '/clp:Verbosity=minimal',
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! UNCAUGHT EXCEPTION
npm ERR! gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin\MSBuild.exe ENOENT
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:283:19)
npm ERR! gyp ERR! stack at onErrorNT (node:internal/child_process:476:16)
npm ERR! gyp ERR! stack at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command "D:\\Program Files\\nodejs\\node.exe" "D:\\Users\\Ismael\\AppData\\Roaming\\nvm\\v18.0.0\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--release"
npm ERR! gyp ERR! cwd C:\Users\Ismael\OneDrive\Desktop\elysium dashboard\node_modules\better-sqlite3
npm ERR! gyp ERR! node -v v18.0.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! Node-gyp failed to build your package.
npm ERR! gyp ERR! Try to update npm and/or node-gyp and if it does not help file an issue with the package author.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Ismael\AppData\Local\npm-cache\_logs\2022-04-24T01_25_04_197Z-debug-0.log
i have tried alot of solutions suggested on different sites including stackoverflow but nothing seemed to work installed windows build tools, python, c++, node-gyp, fixed environment variables and im on the latest release of node (notice that it didnt work on node v17.6.0 either) if this could help, i upgrade/downgrade versions using nvm.
i'd like to note that i also had this problem with installing it back when v12 was the latest version and i just upgraded to it and it worked but now upgrading or downgrading doesnt work at all.

How do i resolve NPM install error code 1?

is anyone able to advice/guide me through this? Do i have a binding.gyp package?
npm ERR! code 1
npm ERR! path C:\Users\Kayven Jong\Desktop\Roboape\roboape-main\node_modules\libpq
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#7.1.2
npm ERR! gyp info using node#14.17.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.9.5 found at "C:\Users\Kayven Jong\AppData\Local\Programs\Python\Python39\python.exe"
npm ERR! gyp info find VS using VS2019 (16.10.31402.337) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Users\Kayven Jong\AppData\Local\Programs\Python\Python39\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'binding.gyp',
npm ERR! gyp info spawn args '-f',
npm ERR! gyp info spawn args 'msvs',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\Kayven Jong\\Desktop\\Roboape\\roboape-main\\node_modules\\libpq\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\Kayven Jong\\AppData\\Local\\node-gyp\\Cache\\14.17.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args '-Dlibrary=shared_library',
npm ERR! gyp info spawn args '-Dvisibility=default',
npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\Kayven Jong\\AppData\\Local\\node-gyp\\Cache\\14.17.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\Kayven Jong\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\Kayven Jong\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\14.17.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\Users\\Kayven Jong\\Desktop\\Roboape\\roboape-main\\node_modules\\libpq',
npm ERR! gyp info spawn args '-Dnode_engine=v8',
npm ERR! gyp info spawn args '--depth=.',
npm ERR! gyp info spawn args '--no-parallel',
npm ERR! gyp info spawn args '--generator-output',
npm ERR! gyp info spawn args 'C:\\Users\\Kayven Jong\\Desktop\\Roboape\\roboape-main\\node_modules\\libpq\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! 'pg_config' is not recognized as an internal or external command,
npm ERR! operable program or batch file.
npm ERR! gyp: Call to 'pg_config --libdir' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack at ChildProcess.onCpExit (C:\Users\Kayven Jong\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (events.js:376:20)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19041
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Kayven Jong\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\Kayven Jong\Desktop\Roboape\roboape-main\node_modules\libpq
npm ERR! gyp ERR! node -v v14.17.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok

Resources