npm i Error: `gyp` failed with exit code: 1

npm i Error: `gyp` failed with exit code: 1

我正在尝试使用 npm 6.14.13 在 Windows 10 上安装模块 当我输入 npm i 我得到:

gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:376:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--module=C:\Users\קלמן\SellersLog\sellerslog-server\node_modules\canvas\build\Release\canvas.node" "--module_name=canvas" "--module_path=C:\Users\קלמן\SellersLog\sellerslog-server\node_modules\canvas\build\Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd C:\Users\קלמן\SellersLog\sellerslog-server\node_modules\canvas
gyp ERR! node -v v14.17.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\קלמן\SellersLog\sellerslog-server\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\קלמן\SellersLog\sellerslog-server\node_modules\canvas\build\Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\קלמן\SellersLog\sellerslog-server\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:376:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1055:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Windows_NT 10.0.18363
node-pre-gyp ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Users\קלמן\SellersLog\sellerslog-server\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"    
node-pre-gyp ERR! cwd C:\Users\קלמן\SellersLog\sellerslog-server\node_modules\canvas
node-pre-gyp ERR! node -v v14.17.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --module=C:\Users\קלמן\Sellenode_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm WARN rollback Rolling back debug@3.2.6 failed (this is probably harmless): EPERM: operation not permitted, scandir 'C:\Users\קלמן\SellersLog\sellerslog-server\node_modules\needle\node_modules'     
npm WARN sellerslog-server@1.0.0 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@2.6.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

我也提前知道了,不知道这个重要不重要:

node-pre-gyp WARN Using request for node-pre-gyp https download 
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-v83-win32-unknown-ia32.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for canvas@2.6.1 and node@14.17.0 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) 

注意:已经尝试过 windows-build-tools - 对我不起作用

基于

canvas-v2.6.1-node-v83-win32-unknown-ia32.tar.gz

C:\Program Files (x86)\nodejs\node.exe

您使用的是 32 位Node.js。

基于 this list,预构建的 node-canvas 二进制文件仅适用于 64 位 Node.js 二进制文件。

我建议卸载您的 32 位 Node.js 并安装一个 64 位的。