Getting error While installing FFI in NodeJS - node.js

I am trying to install ffi but I am getting an error. I have installed all the dependencies i.e. python and windows build tools before installing ffi.
Below is the complete error that I am getting:
npm WARN deprecated tar#2.2.2: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code 1
npm ERR! path E:\xampp\htdocs\Start\test\node_modules\ffi
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#16.18.0 | win32 | x64
npm ERR! (node:8368) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn C:\Users\amit.joshi\.windows-build-tools\python27\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'E:\\xampp\\htdocs\\Start\\test\\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 '-G',
npm ERR! gyp info spawn args 'msvs_version=2017',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'E:\\xampp\\htdocs\\Start\\test\\node_modules\\ffi\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'E:\\xampp\\htdocs\\Start\\test\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args '-I',
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\\x\\.node-gyp\\16.18.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=E:\\xampp\\htdocs\\Start\\test\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\Users\\xxxx\\.node-gyp\\16.18.0\\<(target_arch)\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=E:\\xampp\\htdocs\\Start\\test\\node_modules\\ffi',
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 'E:\\xampp\\htdocs\\Start\\test\\node_modules\\ffi\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR! File "E:\xampp\htdocs\Start\test\node_modules\node-gyp\gyp\gyp_main.py", line 16, in <module>
npm ERR! sys.exit(gyp.script_main())
npm ERR! File "E:\xampp\htdocs\Start\test\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 545, in script_main
npm ERR! return main(sys.argv[1:])
npm ERR! File "E:\xampp\htdocs\Start\test\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 538, in main
npm ERR! return gyp_main(args)
npm ERR! File "E:\xampp\htdocs\Start\test\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 514, in gyp_main
npm ERR! options.duplicate_basename_check)
npm ERR! File "E:\xampp\htdocs\Start\test\node_modules\node-gyp\gyp\pylib\gyp\MSVSVersion.py", line 434, in SelectVisualStudioVersion
npm ERR! versions = _DetectVisualStudioVersions(version_map[version], 'e' in version)
npm ERR! KeyError: '2017'
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 (E:\xampp\htdocs\Start\test\node_modules\node-gyp\lib\configure.js:345: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:293:12)
npm ERR! gyp ERR! System Windows_NT 10.0.22000
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "E:\\xampp\\htdocs\\Start\\test\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd E:\xampp\htdocs\Start\test\node_modules\ffi
npm ERR! gyp ERR! node -v v16.18.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
Not sure how to fix this.

Related

npm install issue in Mac M1 model

I am trying to install npm in Mac m1 model but I keep getting the below error and I tried npm install --force but still error keeps occurring.
npm ERR! code 1
npm ERR! path /Users/anishbabu/Documents/platform/node_modules/zeromq
npm ERR! command failed
npm ERR! command sh -c -- (shx test -f ./script/build.js || run-s build.js) && cross-env npm_config_build_from_source=true node-gyp-build
npm ERR! dlopen(/Users/anishbabu/Documents/platform/node_modules/zeromq/prebuilds/darwin-arm64/node.napi.glibc.node, 0x0001): Library not loaded: '/Users/runner/arm-target/opt/libsodium/lib/libsodium.23.dylib'
npm ERR! Referenced from: '/Users/anishbabu/Documents/platform/node_modules/zeromq/prebuilds/darwin-arm64/node.napi.glibc.node'
npm ERR! Reason: tried: '/Users/runner/arm-target/opt/libsodium/lib/libsodium.23.dylib' (no such file), '/usr/local/lib/libsodium.23.dylib' (no such file), '/usr/lib/libsodium.23.dylib' (no such file)
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.13.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.11.0 found at "/Library/Frameworks/Python.framework/Versions/3.11/bin/python3"
npm ERR! gyp info spawn /Library/Frameworks/Python.framework/Versions/3.11/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/opt/homebrew/Cellar/node#18/18.13.0_1/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 '/Users/anishbabu/Documents/platform/node_modules/zeromq/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/opt/homebrew/Cellar/node#18/18.13.0_1/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/anishbabu/Library/Caches/node-gyp/18.13.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=/Users/anishbabu/Library/Caches/node-gyp/18.13.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/opt/homebrew/Cellar/node#18/18.13.0_1/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/anishbabu/Library/Caches/node-gyp/18.13.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/anishbabu/Documents/platform/node_modules/zeromq',
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! Package libsodium was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing libsodium.pc' npm ERR! to the PKG_CONFIG_PATH environment variable npm ERR! No package 'libsodium' found npm ERR! gyp: Call to 'pkg-config libsodium --libs' 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 (/opt/homebrew/Cellar/node#18/18.13.0_1/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:284:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
npm ERR! gyp ERR! System Darwin 21.6.0
npm ERR! gyp ERR! command "/opt/homebrew/Cellar/node#18/18.13.0_1/bin/node" "/opt/homebrew/Cellar/node#18/18.13.0_1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd /Users/anishbabu/Documents/platform/node_modules/zeromq
npm ERR! gyp ERR! node -v v18.13.0
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok

Node-gyp build error on mac for npm install

I have an Angular app and I am trying to set up it in my local Mac machine. But when I use npm install to install the dependencies, I get the following error
npm ERR! code 1
npm ERR! path /Users/tum/Desktop/nx-pricing-sample/node_modules/#parcel/watcher
npm ERR! command failed
npm ERR! command sh -c -- node-gyp-build
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#16.19.0 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.12.0 found at "/Library/Frameworks/Python.framework/Versions/3.12/bin/python3"
npm ERR! (node:2058) \[DEP0150\] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn /Library/Frameworks/Python.framework/Versions/3.12/bin/python3
npm ERR! gyp info spawn args \[
npm ERR! gyp info spawn args '/Users/tum/Desktop/nx-pricing-sample/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 '/Users/tum/Desktop/nx-pricing-sample/node_modules/#parcel/watcher/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/tum/Desktop/nx-pricing-sample/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/tum/Library/Caches/node-gyp/16.19.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=/Users/tum/Library/Caches/node-gyp/16.19.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/tum/Desktop/nx-pricing-sample/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/tum/Library/Caches/node-gyp/16.19.0/\<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/tum/Desktop/nx-pricing-sample/node_modules/#parcel/watcher',
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! Traceback (most recent call last):
npm ERR! File "/Users/tum/Desktop/nx-pricing-sample/node_modules/node-gyp/gyp/gyp_main.py", line 51, in \<module\>
npm ERR! sys.exit(gyp.script_main())
npm ERR! ^^^^^^^^^^^^^^^^^
npm ERR! File "/Users/tum/Desktop/nx-pricing-sample/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 670, in script_main
npm ERR! return main(sys.argv\[1:\])
npm ERR! ^^^^^^^^^^^^^^^^^^
npm ERR! File "/Users/tum/Desktop/nx-pricing-sample/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 662, in main
npm ERR! return gyp_main(args)
npm ERR! ^^^^^^^^^^^^^^
npm ERR! File "/Users/tum/Desktop/nx-pricing-sample/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 629, in gyp_main
npm ERR! \[generator, flat_list, targets, data\] = Load(
npm ERR! ^^^^^
npm ERR! File "/Users/tum/Desktop/nx-pricing-sample/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 150, in Load
npm ERR! result = gyp.input.Load(
npm ERR! ^^^^^^^^^^^^^^^
npm ERR! File "/Users/tum/Desktop/nx-pricing-sample/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 3021, in Load
npm ERR! LoadTargetBuildFile(
npm ERR! File "/Users/tum/Desktop/nx-pricing-sample/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 411, in LoadTargetBuildFile
npm ERR! build_file_data = LoadOneBuildFile(
npm ERR! ^^^^^^^^^^^^^^^^^
npm ERR! File "/Users/tum/Desktop/nx-pricing-sample/node_modules/node-gyp/gyp/pylib/gyp/input.py", line 239, in LoadOneBuildFile
npm ERR! build_file_contents = open(build_file_path, "rU").read()
npm ERR! ^^^^^^^^^^^^^^^^^^^^^^^^^^^
npm ERR! ValueError: invalid mode: 'rU' 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 (/Users/tum/Desktop/nx-pricing-sample/node_modules/node-gyp/lib/configure.js:351: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:293:12)
npm ERR! gyp ERR! System Darwin 22.1.0
npm ERR! gyp ERR! command "/Users/tum/.nvm/versions/node/v16.19.0/bin/node" "/Users/tum/Desktop/nx-pricing-sample/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /Users/tum/Desktop/nx-pricing-sample/node_modules/#parcel/watcher
npm ERR! gyp ERR! node -v v16.19.0
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/tum/.npm/\_logs/2022-12-17T06_03_21_928Z-debug-0.log
The U mode has been deprecated for a while, and was finally removed in Python 3.11.
Unfortuantely, gyp still uses this mode, and is thus incompatible with Python 3.11 (see, e.g., https://github.com/nodejs/node-gyp/blob/main/README.md#on-macos). Downgrading to Python 3.10 should solve the issue.

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.

I'm trying to Install the NCD packages for my wireless devices from the command prompt, for node-red and keep getting these errors?

C:\Users\a_sal>npm i ncd-red-wireless node-red-dashboard
npm ERR! code 1
npm ERR! path C:\Users\a_sal\node_modules#serialport\bindings
npm ERR! command failed
npm ERR! command C:\windows\system32\cmd.exe /d /s /c prebuild-install --tag-prefix #serialport/bindings# || 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#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 VS2019 (16.11.32802.440) 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:\Python310\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args 'C:\Users\a_sal\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\a_sal\node_modules\#serialport\bindings\build\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\Users\a_sal\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\a_sal\AppData\Local\node-gyp\Cache\16.17.0\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\a_sal\AppData\Local\node-gyp\Cache\16.17.0',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\Users\a_sal\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\Users\\a_sal\\AppData\\Local\\node-gyp\\Cache\\16.17.0\\<(target_arch)\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\Users\a_sal\node_modules\#serialport\bindings',
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\a_sal\node_modules\#serialport\bindings\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! gyp: C:\Users\a_sal\AppData\Local\node-gyp\Cache\16.17.0\common.gypi not found (cwd: C:\Users\a_sal\node_modules#serialport\bindings) while reading includes 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 (C:\Users\a_sal\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:284: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 Windows_NT 10.0.19044
npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\a_sal\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\a_sal\node_modules#serialport\bindings
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\a_sal\AppData\Local\npm-cache_logs\2022-08-30T04_33_46_759Z-debug-0.log

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