Cant install frpc tools package - javascript

when I'm trying to install grpc-tools I get this massive error:
I really don't know what to do
npm ERR! win_delay_load_hook.cc npm ERR! z.vcxproj -> F:\NodeJS Projects\Noosa\npg\node_modules\grpc\build\Release\\libz.lib
npm ERR! Failed to execute 'F:\Node js\node.exe C:\Users\Lidor
German\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js
build --fallback-to-build --library=static_library --module=F:\NodeJS
Projects\Noosa\npg\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown\grpc_node.node
--module_name=grpc_node --module_path=F:\NodeJS Projects\Noosa\npg\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown
--napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1) npm ERR! node-pre-gyp info it worked if it ends with ok npm ERR! node-pre-gyp info using
node-pre-gyp#0.14.0 npm ERR! node-pre-gyp info using node#16.17.0 |
win32 | x64 npm ERR! node-pre-gyp WARN Using request for node-pre-gyp
https download npm ERR! node-pre-gyp info check checked for "F:\NodeJS
Projects\Noosa\npg\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown\grpc_node.node"
(not found) npm ERR! node-pre-gyp http GET
https://node-precompiled-binaries.grpc.io/grpc/v1.24.2/node-v93-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp http 404
https://node-precompiled-binaries.grpc.io/grpc/v1.24.2/node-v93-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404):
https://node-precompiled-binaries.grpc.io/grpc/v1.24.2/node-v93-win32-x64-unknown.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for
grpc#1.24.2 and node#16.17.0 (node-v93 ABI, unknown) (falling back to
source compile with node-gyp) npm ERR! node-pre-gyp http 404 status
code downloading tarball
https://node-precompiled-binaries.grpc.io/grpc/v1.24.2/node-v93-win32-x64-unknown.tar.gz
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 ok 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:\Users\Lidor
German\AppData\Local\Programs\Python\Python310\python.exe" npm ERR!
gyp info find VS using VS2017 (15.9.28307.1500) found at: npm ERR! gyp
info find VS "C:\Program Files (x86)\Microsoft Visual
Studio\2017\BuildTools" npm ERR! gyp info find VS run with --verbose
for detailed information npm ERR! gyp info spawn C:\Users\Lidor
German\AppData\Local\Programs\Python\Python310\python.exe npm ERR! gyp
info spawn args [ npm ERR! gyp info spawn args 'C:\Users\Lidor
German\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 'F:\NodeJS
Projects\Noosa\npg\node_modules\grpc\build\config.gypi', npm
ERR! gyp info spawn args '-I', npm ERR! gyp info spawn args
'C:\Users\Lidor
German\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\Lidor
German\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\Lidor
German\AppData\Local\node-gyp\Cache\16.17.0', npm ERR! gyp info
spawn args '-Dnode_gyp_dir=C:\Users\Lidor
German\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\Users\\Lidor
German\\AppData\\Local\\node-gyp\\Cache\\16.17.0\\<(target_arch)\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=F:\NodeJS
Projects\Noosa\npg\node_modules\grpc', 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
'F:\NodeJS Projects\Noosa\npg\node_modules\grpc\build', npm ERR!
gyp info spawn args '-Goutput_dir=.' npm ERR! gyp info spawn args ]
npm ERR! gyp info ok 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 spawn C:\Program Files
(x86)\Microsoft Visual
Studio\2017\BuildTools\MSBuild\15.0\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\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe failed with exit
code: 1 npm ERR! gyp ERR! stack at ChildProcess.onExit
(C:\Users\Lidor
German\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 "F:\Node
js\node.exe" "C:\Users\Lidor
German\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js"
"build" "--fallback-to-build" "--library=static_library"
"--module=F:\NodeJS
Projects\Noosa\npg\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown\grpc_node.node"
"--module_name=grpc_node" "--module_path=F:\NodeJS
Projects\Noosa\npg\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown"
"--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0"
"--node_napi_label=node-v93" npm ERR! gyp ERR! cwd F:\NodeJS
Projects\Noosa\npg\node_modules\grpc 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! node-pre-gyp ERR! build error npm ERR! node-pre-gyp ERR!
stack Error: Failed to execute 'F:\Node js\node.exe C:\Users\Lidor
German\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js
build --fallback-to-build --library=static_library --module=F:\NodeJS
Projects\Noosa\npg\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown\grpc_node.node
--module_name=grpc_node --module_path=F:\NodeJS Projects\Noosa\npg\node_modules\grpc\src\node\extension_binary\node-v93-win32-x64-unknown
--napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1) npm ERR! node-pre-gyp ERR! stack at ChildProcess. (F:\NodeJS
Projects\Noosa\npg\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit
(node:events:513:28) npm ERR! node-pre-gyp ERR! stack at
maybeClose (node:internal/child_process:1093:16) npm ERR! node-pre-gyp
ERR! stack at Process.ChildProcess._handle.onexit
(node:internal/child_process:302:5) npm ERR! node-pre-gyp ERR! System
Windows_NT 10.0.19044 npm ERR! node-pre-gyp ERR! command "F:\Node
js\node.exe" "F:\NodeJS
Projects\Noosa\npg\node_modules\grpc\node_modules\node-pre-gyp\bin\node-pre-gyp"
"install" "--fallback-to-build" "--library=static_library" npm ERR!
node-pre-gyp ERR! cwd F:\NodeJS Projects\Noosa\npg\node_modules\grpc
npm ERR! node-pre-gyp ERR! node -v v16.17.0 npm ERR! node-pre-gyp ERR!
node-pre-gyp -v v0.14.0 npm ERR! node-pre-gyp ERR! not ok npm ERR! A
complete log of this run can be found in: npm ERR! C:\Users\Lidor
German\AppData\Local\npm-cache_logs\2022-09-05T08_30_41_064Z-debug-0.log

That error is a failure to install the grpc package. That package is deprecated, and is not compatible with Node 16. That dependency should be replaced with #grpc/grpc-js.

Related

Unable to install node_modules in Express js

I'm try to install node_modules from package.json file but i got error.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: nfttoken#1.0.0
npm ERR! Found: mongoose#5.13.15
npm ERR! node_modules/mongoose
npm ERR! mongoose#"^5.13.7" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer mongoose#"^4.1.12" from mongoose-auto-increment#5.0.1
npm ERR! node_modules/mongoose-auto-increment
npm ERR! mongoose-auto-increment#"^5.0.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
My package json dependencies
"dependencies": {
"express": "^4.17.1",
"express-fileupload": "^1.2.1",
"express-validator": "^6.12.1",
"mongoose": "^5.13.7",
"mongoose-auto-increment": "^5.0.1",
"mongoose-sequence": "^5.3.1",
"xml-formatter": "^2.6.1",
"xml2json": "^0.12.0"
}
how can i solve this.
EDIT:
I just run npm install i got below errors.
npm ERR! code 1
npm ERR! path <PROJECT-PATH>backend/node_modules/node-expat
npm ERR! command failed
npm ERR! command sh /tmp/install-1e860795.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.0 | linux | x64
npm ERR! gyp info find Python using Python version 3.8.10 found at "/usr/bin/python3"
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 '<PROJECT-PATH>backend/node_modules/node-expat/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 '<HOME-PATH>.cache/node-gyp/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=<HOME-PATH>.cache/node-gyp/16.17.0',
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=<HOME-PATH>.cache/node-gyp/16.17.0/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=<PROJECT-PATH>backend/node_modules/node-expat',
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 ERR! build error
npm ERR! gyp ERR! stack Error: not found: make
npm ERR! gyp ERR! stack at getNotFoundError (/usr/lib/node_modules/npm/node_modules/which/which.js:10:17)
npm ERR! gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:57:18
npm ERR! gyp ERR! stack at new Promise (<anonymous>)
npm ERR! gyp ERR! stack at step (/usr/lib/node_modules/npm/node_modules/which/which.js:54:21)
npm ERR! gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:71:22
npm ERR! gyp ERR! stack at new Promise (<anonymous>)
npm ERR! gyp ERR! stack at subStep (/usr/lib/node_modules/npm/node_modules/which/which.js:69:33)
npm ERR! gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:80:22
npm ERR! gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/index.js:42:5
npm ERR! gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/isexe/mode.js:8:5
npm ERR! gyp ERR! System Linux 5.15.0-46-generic
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 <PROJECT-PATH>backend/node_modules/node-expat
npm ERR! gyp ERR! node -v v16.17.0
npm ERR! gyp ERR! node-gyp -v v9.0.0
npm ERR! gyp ERR! not ok
Did you read the error? That mongoose-auto-increment library requires version 4 of mongoose, but you have mongoose 5.
You can see if things might work by adding one of the options suggested in the error, i.e. npm i --legacy-peer-deps or npm i --force, or you might want to look for a newer versionf of mongoose-auto-increment that claims support for Mongoose 5 (though that seems to be unlikely, since that last version of that library was released 7 years ago).
Would you please remove node_modules folder from the root of your project?
Then try to run
npm install
If this is still the problem. Try removing node_modules folder again and run
npm i --legacy-peer-deps
If this still not works, try to downgrade/upgrade the package mongoose-auto-increment
I hope those steps will work. Let me know this problem still persits.
For anyone else facing the same issue.
One(or more) dependency in the package.json is not compatible with the latest version of nodejs.
easy solution - downgrade to lower versions of nodejs using nvm
extra work but better solution - install all the dependencies one-by-one and find the package that is causing the error and find the latest alternative for that package

error trying to install npm i mapbox/blend in node

i am trying to install mapbox/blend, but when i run npm i #mapbox/blend finish with error and does not install
node -v --> v16.15.1
error log:
PS C:\Users\Adrian\Desktop\85k> npm i #mapbox/blend
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code 1
npm ERR! path C:\Users\Adrian\Desktop\85k\node_modules\mapnik
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Adrian\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Adrian\Desktop\85k\node_modules\mapnik\lib\binding\mapnik.node --module_name=mapnik --module_path=C:\Users\Adrian\Desktop\85\node_modules\mapnik\lib\binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp#1.0.9
npm ERR! node-pre-gyp info using node#16.15.1 | win32 | x64
npm ERR! node-pre-gyp info check checked for "C:\Users\Adrian\Desktop\85k\node_modules\mapnik\lib\binding\mapnik.node" (not found)
npm ERR! node-pre-gyp http GET https://mapbox-node-binary.s3.amazonaws.com/mapnik/v4.5.9/Release/win32-x64.tar.gz
npm ERR! node-pre-gyp ERR! install response status 403 Forbidden on https://mapbox-node-binary.s3.amazonaws.com/mapnik/v4.5.9/Release/win32-x64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for mapnik#4.5.9 and node#16.15.1 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 403 Forbidden on https://mapbox-node-binary.s3.amazonaws.com/mapnik/v4.5.9/Release/win32-x64.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#8.4.1
npm ERR! gyp info using node#16.15.1 | win32 | x64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#8.4.1
npm ERR! gyp info using node#16.15.1 | win32 | x64
npm ERR! gyp info find Python using Python version 3.10.1 found at "C:\Python310\python.exe"
npm ERR! gyp info find VS using VS2019 (16.11.32510.428) 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\\Adrian\\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\\Adrian\\Desktop\\85k\\node_modules\\mapnik\\build\\config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\Adrian\\Desktop\\85k\\node_modules\\mapnik\\common.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args 'C:\\Users\\Adrian\\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\\Adrian\\AppData\\Local\\node-gyp\\Cache\\16.15.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=C:\\Users\\Adrian\\AppData\\Local\\node-gyp\\Cache\\16.15.1',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\Adrian\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\Adrian\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.15.1\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\Users\\Adrian\\Desktop\\85k\\node_modules\\mapnik',
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\\Adrian\\Desktop\\85\\node_modules\\mapnik\\build',
npm ERR! gyp info spawn args '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! "mapnik-config" no se reconoce como un comando interno o externo,
npm ERR! programa o archivo por lotes ejecutable.
npm ERR! gyp: Call to 'mapnik-config --includes' 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\Adrian\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:259:16)
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.19043
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Adrian\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\\Users\\Adrian\\Desktop\\85\\node_modules\\mapnik\\lib\\binding\\mapnik.node" "--module_name=mapnik" "--module_path=C:\\Users\\Adrian\\Desktop\\85\\node_modules\\mapnik\\lib\\binding" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
npm ERR! gyp ERR! cwd C:\Users\Adrian\Desktop\85\node_modules\mapnik
npm ERR! gyp ERR! node -v v16.15.1
npm ERR! gyp ERR! node-gyp -v v8.4.1
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\Adrian\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\Adrian\Desktop\85k\node_modules\mapnik\lib\binding\mapnik.node --module_name=mapnik --module_path=C:\Users\Adrian\Desktop\85k\node_modules\mapnik\lib\binding --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\Adrian\Desktop\85k\node_modules\#mapbox\node-pre-gyp\lib\util\compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:527:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1092:16)
npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5)
npm ERR! node-pre-gyp ERR! System Windows_NT 10.0.19043
npm ERR! node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Adrian\\Desktop\\85\\node_modules\\#mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd C:\Users\Adrian\Desktop\85\node_modules\mapnik
npm ERR! node-pre-gyp ERR! node -v v16.15.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.9
npm ERR! node-pre-gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Adrian\AppData\Local\npm-cache\_logs\2022-06-10T21_58_47_396Z-debug-0.log

is it possible to install canvas with M1 chip

When I run this command in MacBook Pro M1 to install canvas:
npm install --save-dev canvas
shows error:
npm ERR! code 1
npm ERR! path /Users/xiaoqiangjiang/source/reddwarf/frontend/js-wheel/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute '/Users/xiaoqiangjiang/.nvm/versions/node/v16.13.2/bin/node /Users/xiaoqiangjiang/.nvm/versions/node/v16.13.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/xiaoqiangjiang/source/reddwarf/frontend/js-wheel/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/xiaoqiangjiang/source/reddwarf/frontend/js-wheel/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp#1.0.8
npm ERR! node-pre-gyp info using node#16.13.2 | darwin | arm64
npm ERR! node-pre-gyp info check checked for "/Users/xiaoqiangjiang/source/reddwarf/frontend/js-wheel/node_modules/canvas/build/Release/canvas.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.9.0/canvas-v2.9.0-node-v93-darwin-unknown-arm64.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.9.0/canvas-v2.9.0-node-v93-darwin-unknown-arm64.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for canvas#2.9.0 and node#16.13.2 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.9.0/canvas-v2.9.0-node-v93-darwin-unknown-arm64.tar.gz
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#8.3.0
npm ERR! gyp info using node#16.13.2 | darwin | arm64
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp#8.3.0
npm ERR! gyp info using node#16.13.2 | darwin | arm64
npm ERR! gyp info find Python using Python version 3.10.1 found at "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3"
npm ERR! gyp info spawn /Library/Frameworks/Python.framework/Versions/3.10/bin/python3
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args '/Users/xiaoqiangjiang/.nvm/versions/node/v16.13.2/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/xiaoqiangjiang/source/reddwarf/frontend/js-wheel/node_modules/canvas/build/config.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/xiaoqiangjiang/.nvm/versions/node/v16.13.2/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
npm ERR! gyp info spawn args '-I',
npm ERR! gyp info spawn args '/Users/xiaoqiangjiang/Library/Caches/node-gyp/16.13.2/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/xiaoqiangjiang/Library/Caches/node-gyp/16.13.2',
npm ERR! gyp info spawn args '-Dnode_gyp_dir=/Users/xiaoqiangjiang/.nvm/versions/node/v16.13.2/lib/node_modules/npm/node_modules/node-gyp',
npm ERR! gyp info spawn args '-Dnode_lib_file=/Users/xiaoqiangjiang/Library/Caches/node-gyp/16.13.2/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/Users/xiaoqiangjiang/source/reddwarf/frontend/js-wheel/node_modules/canvas',
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! /bin/sh: pkg-config: command not found
npm ERR! gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 127 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 (/Users/xiaoqiangjiang/.nvm/versions/node/v16.13.2/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:261:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 21.3.0
npm ERR! gyp ERR! command "/Users/xiaoqiangjiang/.nvm/versions/node/v16.13.2/bin/node" "/Users/xiaoqiangjiang/.nvm/versions/node/v16.13.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/xiaoqiangjiang/source/reddwarf/frontend/js-wheel/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/Users/xiaoqiangjiang/source/reddwarf/frontend/js-wheel/node_modules/canvas/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v93"
npm ERR! gyp ERR! cwd /Users/xiaoqiangjiang/source/reddwarf/frontend/js-wheel/node_modules/canvas
npm ERR! gyp ERR! node -v v16.13.2
npm ERR! gyp ERR! node-gyp -v v8.3.0
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/Users/xiaoqiangjiang/.nvm/versions/node/v16.13.2/bin/node /Users/xiaoqiangjiang/.nvm/versions/node/v16.13.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/xiaoqiangjiang/source/reddwarf/frontend/js-wheel/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/xiaoqiangjiang/source/reddwarf/frontend/js-wheel/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v93' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/Users/xiaoqiangjiang/source/reddwarf/frontend/js-wheel/node_modules/#mapbox/node-pre-gyp/lib/util/compile.js:89:23)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:390:28)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1064:16)
npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
npm ERR! node-pre-gyp ERR! System Darwin 21.3.0
npm ERR! node-pre-gyp ERR! command "/Users/xiaoqiangjiang/.nvm/versions/node/v16.13.2/bin/node" "/Users/xiaoqiangjiang/source/reddwarf/frontend/js-wheel/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /Users/xiaoqiangjiang/source/reddwarf/frontend/js-wheel/node_modules/canvas
npm ERR! node-pre-gyp ERR! node -v v16.13.2
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.8
npm ERR! node-pre-gyp ERR! not ok
does anyone facing the same problem. what should I to to fix it or avoid this problem? The node version is 16.x. I have already tried to install pkgconfig like this:
brew install pkgconfig
I finally found before install cavas in macOS, we need to install some dependencies using brew like this:
brew install pkg-config cairo pango libpng jpeg giflib librsvg
then run the install command again will success. more info from the official document: https://github.com/Automattic/node-canvas

when I clone the code from git and run npm install on the machine, the error is like this. please help me

when I clone the code from git and run npm install on the machine, the error is like this. please help me
npm ERR! code 1
npm ERR! path C:\Users\ADMIN\Desktop\weather_app\complete-node-bootcamp\4-natours\after-section-14\node_modules\deasync
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node ./build.js
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#14.15.4 | 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 (C:\Users\ADMIN\node_modules\node-gyp\lib\configure.js:484:19)
npm ERR! gyp ERR! stack at PythonFinder.<anonymous> (C:\Users\ADMIN\node_modules\node-gyp\lib\configure.js:509:16)
npm ERR! gyp ERR! stack at callback (C:\Users\ADMIN\node_modules\graceful-fs\polyfills.js:299:20)
npm ERR! gyp ERR! stack at FSReqCallback.oncomplete (fs.js:183:21)
npm ERR! gyp ERR! System Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ADMIN\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\ADMIN\Desktop\weather_app\complete-node-bootcamp\4-natours\after-section-14\node_modules\deasync
npm ERR! gyp ERR! node -v v14.15.4
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm ERR! Build failed
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\ADMIN\AppData\Local\npm-cache\_logs\2021-07-03T16_30_43_130Z-debug.log

How can I ovecome this error in npm install?

I'm a beginner programmer, and I'm making a discord bot using node and discord.js. I need a library named canvas, but it doesn't install!
I programmed and tested this app on my windows pc, then sent it over to my raspberry server. It didn't work, so I tried deleting and installing the library again, but when installing, it gives this error:
(I'm trying to install it with this command: npm install canvas)
npm ERR! code 1
npm ERR! path /home/pi/node/test/node_modules/canvas
npm ERR! command failed
npm ERR! command sh -c node-pre-gyp install --fallback-to-build
npm ERR! Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/pi/node/test/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/pi/node/test/node_modules/canvas/build/Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v88' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp info using node-pre-gyp#0.11.0
npm ERR! node-pre-gyp info using node#15.0.1 | linux | arm
npm ERR! node-pre-gyp WARN Using needle for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "/home/pi/node/test/node_modules/canvas/build/Release/canvas.node" (not found)
npm ERR! node-pre-gyp http GET https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v88-linux-glibc-arm.tar.gz
npm ERR! node-pre-gyp http 404 https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v88-linux-glibc-arm.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v88-linux-glibc-arm.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for canvas#2.6.1 and node#15.0.1 (node-v88 ABI, glibc) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.6.1/canvas-v2.6.1-node-v88-linux-glibc-arm.tar.gz
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#15.0.1 | linux | arm
npm ERR! gyp info ok
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#15.0.1 | linux | arm
npm ERR! gyp info find Python using Python version 3.7.3 found at "/usr/bin/python3"
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/test/node_modules/canvas/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 '/home/pi/.cache/node-gyp/15.0.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=/home/pi/.cache/node-gyp/15.0.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=/home/pi/.cache/node-gyp/15.0.1/<(target_arch)/node.lib',
npm ERR! gyp info spawn args '-Dmodule_root_dir=/home/pi/node/test/node_modules/canvas',
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 pixman-1 was not found in the pkg-config search path.
npm ERR! Perhaps you should add the directory containing `pixman-1.pc'
npm ERR! to the PKG_CONFIG_PATH environment variable
npm ERR! No package 'pixman-1' found
npm ERR! gyp: Call to 'pkg-config pixman-1 --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 (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:327:20)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:277:12)
npm ERR! gyp ERR! System Linux 5.4.51-v7l+
npm ERR! gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/pi/node/test/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/pi/node/test/node_modules/canvas/build/Release" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v88"
npm ERR! gyp ERR! cwd /home/pi/node/test/node_modules/canvas
npm ERR! gyp ERR! node -v v15.0.1
npm ERR! gyp ERR! node-gyp -v v7.1.2
npm ERR! gyp ERR! not ok
npm ERR! node-pre-gyp ERR! build error
npm ERR! node-pre-gyp ERR! stack Error: Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/pi/node/test/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/pi/node/test/node_modules/canvas/build/Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v88' (1)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/home/pi/node/test/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack at ChildProcess.emit (node:events:327:20)
npm ERR! node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1048:16)
npm ERR! node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:288:5)
npm ERR! node-pre-gyp ERR! System Linux 5.4.51-v7l+
npm ERR! node-pre-gyp ERR! command "/usr/bin/node" "/home/pi/node/test/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd /home/pi/node/test/node_modules/canvas
npm ERR! node-pre-gyp ERR! node -v v15.0.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.11.0
npm ERR! node-pre-gyp ERR! not ok
npm ERR! A complete log of this run can be found in:
npm ERR! /home/pi/.npm/_logs/2020-10-27T20_10_02_765Z-debug.log```
First Try installing the binaries for canvas mentioned in https://github.com/Automattic/node-canvas
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
Then install canvas:
npm install canvas
Did you start by running npm init? I would assume so because of the node_modules folder mentioned in the error, but just checking.
You can install it with homebrew using:
brew install pkg-config cairo pango libpng jpeg giflib librsvg
according to the docs here: https://github.com/Automattic/node-canvas
Works for me on Macbook M1 Pro ->
arch -arm64 brew install pkg-config cairo pango jpeg giflib librsvg

Categories