Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

canvas installation windows failed #1955

Closed
JusteLoneWolf opened this issue Dec 24, 2021 · 5 comments
Closed

canvas installation windows failed #1955

JusteLoneWolf opened this issue Dec 24, 2021 · 5 comments

Comments

@JusteLoneWolf
Copy link

JusteLoneWolf commented Dec 24, 2021

Hello, I followed the installation via Chocolatey, and after the installation of via chocolatay I rebooted then installed GTK 2 and put in C:\GTK, then when I run npm install canvas, I have this error, I have well node-gyp installed.

C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord>npm i canvas
npm ERR! code 1
npm ERR! path C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\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
npm ERR! Les projets sont g�n�r�s individuellement dans cette solution. Pour activer la g�n�ration en parall�le, ajoutez le commutateur "/m".
npm ERR!   Backend.cc
npm ERR! c:\users\zecha\appdata\local\node-gyp\cache\16.13.1\include\node\v8.h(5706): warning C4309: 'static_cast'�: troncation de valeur de constante [C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\node_modules\canvas\build\canvas.vcxproj]
npm ERR!   ImageBackend.cc
npm ERR! c:\users\zecha\appdata\local\node-gyp\cache\16.13.1\include\node\v8.h(5706): warning C4309: 'static_cast'�: troncation de valeur de constante [C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\node_modules\canvas\build\canvas.vcxproj]
npm ERR!   PdfBackend.cc
npm ERR! c:\users\zecha\appdata\local\node-gyp\cache\16.13.1\include\node\v8.h(5706): warning C4309: 'static_cast'�: troncation de valeur de constante [C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\node_modules\canvas\build\canvas.vcxproj]
npm ERR!   SvgBackend.cc
npm ERR! c:\users\zecha\appdata\local\node-gyp\cache\16.13.1\include\node\v8.h(5706): warning C4309: 'static_cast'�: troncation de valeur de constante [C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\node_modules\canvas\build\canvas.vcxproj]
npm ERR!   BMPParser.cc
npm ERR! c:\users\zecha\onedrive\documents\dev\wolfbotdiscord\node_modules\canvas\src\bmp\bmpparser.cc(186): warning C4018: '>'�: incompatibilit� signed/unsigned [C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\node_modules\canvas\build\canvas.vcxproj]
npm ERR! c:\users\zecha\onedrive\documents\dev\wolfbotdiscord\node_modules\canvas\src\bmp\bmpparser.cc(201): warning C4018: '>'�: incompatibilit� signed/unsigned [C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\node_modules\canvas\build\canvas.vcxproj]
npm ERR!   Backends.cc
npm ERR! c:\users\zecha\appdata\local\node-gyp\cache\16.13.1\include\node\v8.h(5706): warning C4309: 'static_cast'�: troncation de valeur de constante [C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\node_modules\canvas\build\canvas.vcxproj]
npm ERR!   Canvas.cc
npm ERR! c:\users\zecha\appdata\local\node-gyp\cache\16.13.1\include\node\v8.h(5706): warning C4309: 'static_cast'�: troncation de valeur de constante [C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\node_modules\canvas\build\canvas.vcxproj]
npm ERR!   CanvasGradient.cc
npm ERR! c:\users\zecha\appdata\local\node-gyp\cache\16.13.1\include\node\v8.h(5706): warning C4309: 'static_cast'�: troncation de valeur de constante [C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\node_modules\canvas\build\canvas.vcxproj]
npm ERR!   CanvasPattern.cc
npm ERR! c:\users\zecha\appdata\local\node-gyp\cache\16.13.1\include\node\v8.h(5706): warning C4309: 'static_cast'�: troncation de valeur de constante [C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\node_modules\canvas\build\canvas.vcxproj]
npm ERR!   CanvasRenderingContext2d.cc
npm ERR! c:\users\zecha\appdata\local\node-gyp\cache\16.13.1\include\node\v8.h(5706): warning C4309: 'static_cast'�: troncation de valeur de constante [C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\node_modules\canvas\build\canvas.vcxproj]
npm ERR! c:\users\zecha\onedrive\documents\dev\wolfbotdiscord\node_modules\canvas\src\util.h(31): error C2039: 'toupper'�: n'est pas membre de 'std' [C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\node_modules\canvas\build\canvas.vcxproj]
npm ERR!   c:\program files (x86)\microsoft visual studio\2017\buildtools\vc\tools\msvc\14.16.27023\include\map(20): note: voir la d�claration de 'std'
npm ERR! Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Users\zecha\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\node_modules\canvas\b
uild\Release\canvas.node --module_name=canvas --module_path=C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\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.1 | win32 | ia32
npm ERR! node-pre-gyp info check checked for "C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\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.8.0/canvas-v2.8.0-node-v93-win32-unknown-ia32.tar.gz
npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/Automattic/node-canvas/releases/download/v2.8.0/canvas-v2.8.0-node-v93-win32-unknown-ia32.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not installable for canvas@2.8.0 and node@16.13.1 (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.8.0/canvas-v2.8.0-node-v93-win32-unknown-ia32.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@16.13.1 | win32 | ia32
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@16.13.1 | win32 | ia32
npm ERR! gyp info find Python using Python version 3.8.10 found at "C:\Users\zecha\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe"
npm ERR! gyp info find VS using VS2017 (15.9.28307.1759) 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! (node:15676) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
npm ERR! (Use `node --trace-deprecation ...` to show where the warning was created)
npm ERR! gyp info spawn C:\Users\zecha\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Users\\zecha\\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\\zecha\\OneDrive\\Documents\\Dev\\WolfBotDiscord\\node_modules\\canvas\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\zecha\\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\\zecha\\AppData\\Local\\node-gyp\\Cache\\16.13.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\\zecha\\AppData\\Local\\node-gyp\\Cache\\16.13.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\zecha\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\zecha\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\16.13.1\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\zecha\\OneDrive\\Documents\\Dev\\WolfBotDiscord\\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   'C:\\Users\\zecha\\OneDrive\\Documents\\Dev\\WolfBotDiscord\\node_modules\\canvas\\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@7.1.2
npm ERR! gyp info using node@16.13.1 | win32 | ia32
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=Win32'
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\zecha\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
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 Windows_NT 10.0.19042
npm ERR! gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\zecha\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\zecha\\OneDrive\\Documents\\Dev\\WolfBotDi
scord\\node_modules\\canvas\\build\\Release\\canvas.node" "--module_name=canvas" "--module_path=C:\\Users\\zecha\\OneDrive\\Documents\\Dev\\WolfBotDiscord\\node_modules\\canvas\\build\\Release" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=0" "--no
de_napi_label=node-v93"
npm ERR! gyp ERR! cwd C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\node_modules\canvas
npm ERR! gyp ERR! node -v v16.13.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 'C:\Program Files (x86)\nodejs\node.exe C:\Users\zecha\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\zecha\OneDrive\Documents\Dev\WolfB
otDiscord\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\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> (C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\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 Windows_NT 10.0.19042
npm ERR! node-pre-gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\zecha\\OneDrive\\Documents\\Dev\\WolfBotDiscord\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
npm ERR! node-pre-gyp ERR! cwd C:\Users\zecha\OneDrive\Documents\Dev\WolfBotDiscord\node_modules\canvas
npm ERR! node-pre-gyp ERR! node -v v16.13.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v1.0.8
npm ERR! node-pre-gyp ERR! not ok

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\zecha\AppData\Local\npm-cache\_logs\2021-12-24T10_04_10_103Z-debug.log

The Chocolatey installation:
image

PS: I also did the manual instation

My Environment

  • NPM : 7.20.0
  • Node : 16.13.1
  • Windows : 10
@zbjornson
Copy link
Collaborator

The prebuilds failed to install because you're using 32-bit Node.js. Are you able to use 64-bit?

A user contributed the Chocolately instructions and, as noted in the wiki, others have reported that they have issues, see #843 in particular.

@forvy
Copy link

forvy commented Jun 8, 2022

The prebuilds failed to install because you're using 32-bit Node.js. Are you able to use 64-bit?

A user contributed the Chocolately instructions and, as noted in the wiki, others have reported that they have issues, see #843 in particular.

I'm using 64-bit, and follow the instructions on https://github.com/Automattic/node-canvas/wiki/Installation:-Windows and https://github.com/nodejs/node-gyp#on-windows still having the same result. Removing package lock and reinstall npm doesn't help either.

Is there no solution so far?

@zbjornson
Copy link
Collaborator

@forvy if you're trying to use Node.js v18, we don't have prebuilds working for that yet. If you open a new issue with the info in the template, I can help more there.


Closing this since it's old and no followup from original poster.

@paivaric
Copy link

paivaric commented Dec 8, 2022

Any news on how to install it into node 18?

@zbjornson
Copy link
Collaborator

@paivaric Node 18 prebuilds have been available for a while, it should just work. Please open an issue if you're running into problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants