HashLips / hashlips_art_engine

HashLips Art Engine is a tool used to create multiple different instances of artworks based on provided layers.
MIT License
7.21k stars 4.3k forks source link

npm i canvas not working #1394

Open Xerphyl opened 2 years ago

Xerphyl commented 2 years ago

npm ERR! code 1 npm ERR! path C:\Users\steph\Downloads\hashlips_art_engine-1.1.2_patch_v6\node_modules\canvas npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build --update-binary npm ERR! Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --update-binary --module=C:\Users\steph\Downloads\hashlips_art_engine-1.1.2_patch_v6\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\steph\Downloads\hashlips_art_engine-1.1.2_patch_v6\node_modules\canvas\build\Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (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.10 npm ERR! node-pre-gyp info using node@18.9.0 | win32 | x64 npm ERR! node-pre-gyp http GET https://github.com/Automattic/node-canvas/releases/download/v2.10.1/canvas-v2.10.1-node-v108-win32-unknown-x64.tar.gz npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.10.1/canvas-v2.10.1-node-v108-win32-unknown-x64.tar.gz npm ERR! node-pre-gyp WARN Pre-built binaries not installable for canvas@2.10.1 and node@18.9.0 (node-v108 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.10.1/canvas-v2.10.1-node-v108-win32-unknown-x64.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@18.9.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@18.9.0 | win32 | x64 npm ERR! gyp info find Python using Python version 3.10.6 found at "C:\Users\steph\AppData\Local\Programs\Python\Python310\python.exe" npm ERR! gyp ERR! find VS npm ERR! gyp ERR! find VS msvs_version not set from command line or npm config npm ERR! gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt npm ERR! gyp ERR! find VS checking VS2022 (17.3.32825.248) found at: npm ERR! gyp ERR! find VS "C:\Program Files\Microsoft Visual Studio\2022\Community" npm ERR! gyp ERR! find VS - found "Visual Studio C++ core features" npm ERR! gyp ERR! find VS - missing any VC++ toolset npm ERR! gyp ERR! find VS could not find a version of Visual Studio 2017 or newer to use npm ERR! gyp ERR! find VS looking for Visual Studio 2015 npm ERR! gyp ERR! find VS - not found npm ERR! gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8 npm ERR! gyp ERR! find VS npm ERR! gyp ERR! find VS ** npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload. npm ERR! gyp ERR! find VS For more information consult the documentation at: npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows npm ERR! gyp ERR! find VS ** npm ERR! gyp ERR! find VS npm ERR! gyp ERR! configure error npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use npm ERR! gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:122:47) npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:75:16 npm ERR! gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:364:14) npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:71:14 npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:385:16 npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7 npm ERR! gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16 npm ERR! gyp ERR! stack at ChildProcess.exithandler (node:child_process:420:5) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:513:28) npm ERR! gyp ERR! stack at maybeClose (node:internal/child_process:1091:16) npm ERR! gyp ERR! System Windows_NT 10.0.19044 npm ERR! gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "configure" "--fallback-to-build" "--update-binary" "--module=C:\Users\steph\Downloads\hashlips_art_engine-1.1.2_patch_v6\node_modules\canvas\build\Release\canvas.node" "--module_name=canvas" "--module_path=C:\Users\steph\Downloads\hashlips_art_engine-1.1.2_patch_v6\node_modules\canvas\build\Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v108" npm ERR! gyp ERR! cwd C:\Users\steph\Downloads\hashlips_art_engine-1.1.2_patch_v6\node_modules\canvas npm ERR! gyp ERR! node -v v18.9.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 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --update-binary --module=C:\Users\steph\Downloads\hashlips_art_engine-1.1.2_patch_v6\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\steph\Downloads\hashlips_art_engine-1.1.2_patch_v6\node_modules\canvas\build\Release --napi_version=8 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v108' (1) npm ERR! node-pre-gyp ERR! stack at ChildProcess. (C:\Users\steph\Downloads\hashlips_art_engine-1.1.2_patch_v6\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23) 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:1091:16) npm ERR! node-pre-gyp ERR! stack at 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 "C:\Program Files\nodejs\node.exe" "C:\Users\steph\Downloads\hashlips_art_engine-1.1.2_patch_v6\node_modules\@mapbox\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build" "--update-binary" npm ERR! node-pre-gyp ERR! cwd C:\Users\steph\Downloads\hashlips_art_engine-1.1.2_patch_v6\node_modules\canvas npm ERR! node-pre-gyp ERR! node -v v18.9.0 npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.10 npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\steph\AppData\Local\npm-cache_logs\2022-09-13T07_23_44_457Z-debug-0.log

bolshoytoster commented 2 years ago

@Xerphyl downgrade node.

Xerphyl commented 2 years ago

what version can i use for this

bolshoytoster commented 2 years ago

@Xerphyl I think version 17 might work, otherwise try older versions.

imjxlian commented 2 years ago

I had the same problem on MacOS, just run this command to install the dependencies for canvas : brew install pkg-config cairo pango libpng jpeg giflib librsvg pixman

lcrostarosa commented 2 years ago

See the pull request I wrote - I set up a docker environment + updated readme. This issue seems to be around M1 macs because they use ARM instead of AMD processing architecture