Open wuhonchi opened 2 years ago
@wuhonchi can you paste the error here please.
I believe I'm having the same issue. Running into these errors when trying $npm install on m2 chip, been trying a lot some different things to resolve but can't find the issue. Works fine in windows.
408 verbose cwd /Users/laughingelephant/Desktop/Coding/hashlips_art_engine-main
409 verbose Darwin 21.6.0
410 verbose node v18.8.0
411 verbose npm v8.18.0
412 error code 1
413 error path /Users/laughingelephant/Desktop/Coding/hashlips_art_engine-main/node_modules/canvas
414 error command failed
415 error command sh -c -- node-pre-gyp install --fallback-to-build --update-binary
416 error Failed to execute '/Users/laughingelephant/.nvm/versions/node/v18.8.0/bin/node /Users/laughingelephant/.nvm/versions/node/v18.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/Users/laughingelephant/Desktop/Coding/hashlips_art_engine-main/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/laughingelephant/Desktop/Coding/hashlips_art_engine-main/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
417 error node-pre-gyp info it worked if it ends with ok
417 error node-pre-gyp info using node-pre-gyp@1.0.9
417 error node-pre-gyp info using node@18.8.0 | darwin | arm64
417 error node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.10.0/canvas-v2.10.0-node-v108-darwin-unknown-arm64.tar.gz
417 error node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.10.0/canvas-v2.10.0-node-v108-darwin-unknown-arm64.tar.gz
417 error node-pre-gyp WARN Pre-built binaries not installable for canvas@2.10.0 and node@18.8.0 (node-v108 ABI, unknown) (falling back to source compile with node-gyp)
417 error node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.10.0/canvas-v2.10.0-node-v108-darwin-unknown-arm64.tar.gz
417 error gyp info it worked if it ends with ok
417 error gyp info using node-gyp@9.1.0
417 error gyp info using node@18.8.0 | darwin | arm64
417 error gyp info ok
417 error gyp info it worked if it ends with ok
417 error gyp info using node-gyp@9.1.0
417 error gyp info using node@18.8.0 | darwin | arm64
417 error gyp info find Python using Python version 3.10.6 found at "/Library/Frameworks/Python.framework/Versions/3.10/bin/python3"
417 error gyp info spawn /Library/Frameworks/Python.framework/Versions/3.10/bin/python3
417 error gyp info spawn args [
417 error gyp info spawn args '/Users/laughingelephant/.nvm/versions/node/v18.8.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
417 error gyp info spawn args 'binding.gyp',
417 error gyp info spawn args '-f',
417 error gyp info spawn args 'make',
417 error gyp info spawn args '-I',
417 error gyp info spawn args '/Users/laughingelephant/Desktop/Coding/hashlips_art_engine-main/node_modules/canvas/build/config.gypi',
417 error gyp info spawn args '-I',
417 error gyp info spawn args '/Users/laughingelephant/.nvm/versions/node/v18.8.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
417 error gyp info spawn args '-I',
417 error gyp info spawn args '/Users/laughingelephant/Library/Caches/node-gyp/18.8.0/include/node/common.gypi',
417 error gyp info spawn args '-Dlibrary=shared_library',
417 error gyp info spawn args '-Dvisibility=default',
417 error gyp info spawn args '-Dnode_root_dir=/Users/laughingelephant/Library/Caches/node-gyp/18.8.0',
417 error gyp info spawn args '-Dnode_gyp_dir=/Users/laughingelephant/.nvm/versions/node/v18.8.0/lib/node_modules/npm/node_modules/node-gyp',
417 error gyp info spawn args '-Dnode_lib_file=/Users/laughingelephant/Library/Caches/node-gyp/18.8.0/<(target_arch)/node.lib',
417 error gyp info spawn args '-Dmodule_root_dir=/Users/laughingelephant/Desktop/Coding/hashlips_art_engine-main/node_modules/canvas',
417 error gyp info spawn args '-Dnode_engine=v8',
417 error gyp info spawn args '--depth=.',
417 error gyp info spawn args '--no-parallel',
417 error gyp info spawn args '--generator-output',
417 error gyp info spawn args 'build',
417 error gyp info spawn args '-Goutput_dir=.'
417 error gyp info spawn args ]
417 error Package pixman-1 was not found in the pkg-config search path.
417 error Perhaps you should add the directory containing pixman-1.pc' 417 error to the PKG_CONFIG_PATH environment variable 417 error No package 'pixman-1' found 417 error gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp 417 error gyp ERR! configure error 417 error gyp ERR! stack Error:
gyp` failed with exit code: 1
417 error gyp ERR! stack at ChildProcess.onCpExit (/Users/laughingelephant/.nvm/versions/node/v18.8.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:284:16)
417 error gyp ERR! stack at ChildProcess.emit (node:events:513:28)
417 error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:291:12)
417 error gyp ERR! System Darwin 21.6.0
417 error gyp ERR! command "/Users/laughingelephant/.nvm/versions/node/v18.8.0/bin/node" "/Users/laughingelephant/.nvm/versions/node/v18.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--update-binary" "--module=/Users/laughingelephant/Desktop/Coding/hashlips_art_engine-main/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/Users/laughingelephant/Desktop/Coding/hashlips_art_engine-main/node_modules/canvas/build/Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108"
417 error gyp ERR! cwd /Users/laughingelephant/Desktop/Coding/hashlips_art_engine-main/node_modules/canvas
417 error gyp ERR! node -v v18.8.0
417 error gyp ERR! node-gyp -v v9.1.0
417 error gyp ERR! not ok
417 error node-pre-gyp ERR! build error
417 error node-pre-gyp ERR! stack Error: Failed to execute '/Users/laughingelephant/.nvm/versions/node/v18.8.0/bin/node /Users/laughingelephant/.nvm/versions/node/v18.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --update-binary --module=/Users/laughingelephant/Desktop/Coding/hashlips_art_engine-main/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/Users/laughingelephant/Desktop/Coding/hashlips_art_engine-main/node_modules/canvas/build/Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1)
417 error node-pre-gyp ERR! stack at ChildProcess.
@LaughingElephant try looking for solutions for running it on M1, since they're the same architecture.
yea node-canvas
binaries are breaking on node 18.0.0+
try dumping the node version, im using v14.18.2
and it works for me
For M2 problems, execute this in your zsh: arch -arm64 brew install pkg-config cairo pango libpng jpeg giflib librsvg
and run npm install ;)
i have just copied my previous project from old computer to M2 , its seems something wrong .... then i tried to git clone a new project in case something wrong with my old project ..... but still can't pass through the npm install ....
thanks