javascriptnode-gypgyp

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


I am trying to install modules on Windows 10 using npm 6.14.13 When I enter npm i I get:

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.

I also get this beforehand, don't know if this is important:

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) 

note: already tried windows-build-tools - didn't work for me


Solution

  • Based on

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

    and

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

    you're using a 32-bit Node.js.

    Based on this list, prebuilt node-canvas binaries exist only for 64-bit Node.js binaries.

    I'd recommend to uninstall your 32-bit Node.js and install a 64-bit one instead.