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

Can't install canvas #1773

Closed
Paultje52 opened this issue Mar 28, 2021 · 18 comments
Closed

Can't install canvas #1773

Paultje52 opened this issue Mar 28, 2021 · 18 comments

Comments

@Paultje52
Copy link

Hello, I can't install canvas. When using npm i canvas, it just stops after a couple seconds. When using npm i -s canvas --verbose, I get this error.

npm ERR! code 1
npm ERR! path C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\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! Warning: Missing input files:
npm ERR! C:\GTK\bin\libpangoft2-1.0-0.dll
npm ERR! C:\GTK\bin\zlib1.dll
npm ERR! C:\GTK\bin\libintl-8.dll
npm ERR! C:\GTK\bin\libgmodule-2.0-0.dll
npm ERR! C:\GTK\bin\libglib-2.0-0.dll
npm ERR! C:\GTK\bin\libexpat-1.dll
npm ERR! C:\GTK\bin\libpng14-14.dll
npm ERR! C:\GTK\bin\libcairo-2.dll
npm ERR! C:\GTK\bin\libfontconfig-1.dll
npm ERR! C:\GTK\bin\libgobject-2.0-0.dll
npm ERR! C:\GTK\bin\libgthread-2.0-0.dll
npm ERR! C:\GTK\bin\libpangocairo-1.0-0.dll
npm ERR! C:\GTK\bin\libfreetype-6.dll
npm ERR! C:\GTK\bin\libpango-1.0-0.dll
npm ERR! C:\GTK\bin\libpangowin32-1.0-0.dll
npm ERR! Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
npm ERR! Build started 28-3-2021 16:59:29.
npm ERR! Project "C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\binding.sln" on node 1 (default targets).
npm ERR! ValidateSolutionConfiguration:
npm ERR!   Building solution configuration "Release|Win32".
npm ERR! Project "C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\binding.sln" (1) is building "C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\canvas-postbuild.vcxproj.metaproj" (2) on node 1 (default targets).
npm ERR! Project "C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\canvas-postbuild.vcxproj.metaproj" (2) is building "C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\canvas.vcxproj" (3) on node 1 (default targets).
npm ERR! PrepareForBuild:
npm ERR!   Creating directory "Release\obj\canvas\".
npm ERR!   Creating directory "Release\obj\canvas\canvas.tlog\".
npm ERR! InitializeBuildStatus:
npm ERR!   Creating "Release\obj\canvas\canvas.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
npm ERR! MakeDirsForCl:
npm ERR!   Creating directory "C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\Release\obj\canvas\src\backend".
npm ERR!   Creating directory "C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\Release\obj\canvas\src\bmp".
npm ERR! ClCompile:
npm ERR!   C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX64\x86\CL.exe /c /I"C:\Users\Paul\AppData\Local\node-gyp\Cache\12.19.1\include\node" /I"C:\Users\Paul\AppData\Local\node-gyp\Cache\12.19.1\src" /I"C:\Users\Paul\AppData\Local\node-gyp\Cache\12.19.1\deps\openssl\config" /I"C:\Users\Paul\AppData\Local\node-gyp\Cache\12.19.1\deps\openssl\openssl\include" /I"C:\Users\Paul\AppData\Local\node-gyp\Cache\12.19.1\deps\uv\include" /I"C:\Users\Paul\AppData\Local\node-gyp\Cache\12.19.1\deps\zlib" /I"C:\Users\Paul\AppData\Local\node-gyp\Cache\12.19.1\deps\v8\include" /I..\..\nan /IC:\GTK\include /IC:\GTK\include\cairo /I"C:\GTK\include\pango-1.0" /I"C:\GTK\include\glib-2.0" /IC:\GTK\include\freetype2 /I"C:\GTK\lib\glib-2.0\include" /Z7 /nologo /W4 /WX- /diagnostics:classic /MP /Ox /Ob2 /Oi /Ot /Oy /GL /D NODE_GYP_MODULE_NAME=canvas /D USING_UV_SHARED=1 /D USING_V8_SHARED=1 /D V8_DEPRECATION_WARNINGS=1 /D V8_DEPRECATION_WARNINGS /D V8_IMMINENT_DEPRECATION_WARNINGS /D WIN32 /D _CRT_SECURE_NO_DEPRECATE /D _CRT_NONSTDC_NO_DEPRECATE /D _HAS_EXCEPTIONS=0 /D OPENSSL_NO_PINSHARED /D OPENSSL_THREADS /D _USE_MATH_DEFINES /D BUILDING_NODE_EXTENSION /D "HOST_BINARY=\"node.exe\"" /D _WINDLL /GF /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Zc:inline /GR- /Fo"Release\obj\canvas\\src\backend\Backend.obj" /Fd"Release\obj\canvas\vc141.pdb" /Gd /TP /wd4100 /wd4611 /wd4351 /wd4355 /wd4800 /wd4251 /wd4275 /wd4244 /wd4267 /analyze- /FC /errorReport:queue ..\src\backend\Backend.cc
npm ERR!   Backend.cc
npm ERR! c:\users\paul\desktop\prive\nodejs\topaz\node_modules\canvas\src\backend\backend.h(3): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory [C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\canvas.vcxproj]
npm ERR! Done Building Project "C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\canvas.vcxproj" (default targets) -- FAILED.
npm ERR! Done Building Project "C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\canvas-postbuild.vcxproj.metaproj" (default targets) -- FAILED.
npm ERR! Done Building Project "C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\binding.sln" (default targets) -- FAILED.
npm ERR!
npm ERR! Build FAILED.
npm ERR!
npm ERR! "C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\binding.sln" (default target) (1) ->
npm ERR! "C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\canvas-postbuild.vcxproj.metaproj" (default target) (2) ->
npm ERR! "C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\canvas.vcxproj" (default target) (3) ->
npm ERR! (ClCompile target) ->
npm ERR!   c:\users\paul\desktop\prive\nodejs\topaz\node_modules\canvas\src\backend\backend.h(3): fatal error C1083: Cannot open include file: 'cairo.h': No such file or directory [C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\canvas.vcxproj]
npm ERR! 
npm ERR!     0 Warning(s)
npm ERR!     1 Error(s)
npm ERR!
npm ERR! Time Elapsed 00:00:01.81
npm ERR! Failed to execute 'C:\Program Files (x86)\nodejs\node.exe C:\Users\Paul\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm ERR! node-pre-gyp info it worked if it ends with ok
npm ERR! node-pre-gyp verb cli [
npm ERR! node-pre-gyp verb cli   'C:\\Program Files (x86)\\nodejs\\node.exe',
npm ERR! node-pre-gyp verb cli   'C:\\Users\\Paul\\Desktop\\Prive\\NodeJS\\Topaz\\node_modules\\canvas\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp',
npm ERR! node-pre-gyp verb cli   'install',
npm ERR! node-pre-gyp verb cli   '--fallback-to-build'
npm ERR! node-pre-gyp verb cli ]
npm ERR! node-pre-gyp info using [email protected]
npm ERR! node-pre-gyp info using [email protected] | win32 | ia32
npm ERR! node-pre-gyp verb command install []
npm ERR! node-pre-gyp WARN Using request for node-pre-gyp https download
npm ERR! node-pre-gyp info check checked for "C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\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.7.0/canvas-v2.7.0-node-v72-win32-unknown-ia32.tar.gz
npm ERR! node-pre-gyp http 404 https://github.com/Automattic/node-canvas/releases/download/v2.7.0/canvas-v2.7.0-node-v72-win32-unknown-ia32.tar.gz
npm ERR! node-pre-gyp WARN Tried to download(404): https://github.com/Automattic/node-canvas/releases/download/v2.7.0/canvas-v2.7.0-node-v72-win32-unknown-ia32.tar.gz
npm ERR! node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v72 ABI, unknown) (falling back to source compile with node-gyp)
npm ERR! node-pre-gyp http 404 status code downloading tarball https://github.com/Automattic/node-canvas/releases/download/v2.7.0/canvas-v2.7.0-node-v72-win32-unknown-ia32.tar.gz 
npm ERR! node-pre-gyp verb command build [ 'rebuild' ]
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files (x86)\\nodejs\\node.exe',
npm ERR! gyp verb cli   'C:\\Users\\Paul\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'clean'
npm ERR! gyp verb cli ]
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | ia32
npm ERR! gyp verb command clean []
npm ERR! gyp verb clean removing "build" directory
npm ERR! gyp info ok
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp verb cli [
npm ERR! gyp verb cli   'C:\\Program Files (x86)\\nodejs\\node.exe',
npm ERR! gyp verb cli   'C:\\Users\\Paul\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'configure',
npm ERR! gyp verb cli   '--fallback-to-build',
npm ERR! gyp verb cli   '--module=C:\\Users\\Paul\\Desktop\\Prive\\NodeJS\\Topaz\\node_modules\\canvas\\build\\Release\\canvas.node',
npm ERR! gyp verb cli   '--module_name=canvas',
npm ERR! gyp verb cli   '--module_path=C:\\Users\\Paul\\Desktop\\Prive\\NodeJS\\Topaz\\node_modules\\canvas\\build\\Release',
npm ERR! gyp verb cli   '--napi_version=7',
npm ERR! gyp verb cli   '--node_abi_napi=napi',
npm ERR! gyp verb cli   '--napi_build_version=0',
npm ERR! gyp verb cli   '--node_napi_label=node-v72',
npm ERR! gyp verb cli   '--python=C:\\Users\\Paul\\.windows-build-tools\\python27\\python.exe'
npm ERR! gyp verb cli ]
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | ia32
npm ERR! gyp verb command configure []
npm ERR! gyp verb find Python checking Python explicitly set from command line or npm configuration
npm ERR! gyp verb find Python - "--python=" or "npm config get python" is "C:\Users\Paul\.windows-build-tools\python27\python.exe"
npm ERR! gyp verb find Python - executing "C:\Users\Paul\.windows-build-tools\python27\python.exe" to get executable path
npm ERR! gyp verb find Python - executable path is "C:\Users\Paul\.windows-build-tools\python27\python.exe"
npm ERR! gyp verb find Python - executing "C:\Users\Paul\.windows-build-tools\python27\python.exe" to get version
npm ERR! gyp verb find Python - version is "2.7.15"
npm ERR! gyp info find Python using Python version 2.7.15 found at "C:\Users\Paul\.windows-build-tools\python27\python.exe"
npm ERR! gyp verb get node dir no --target version specified, falling back to host node version: 12.19.1
npm ERR! gyp verb command install [ '12.19.1' ]
npm ERR! gyp verb install input version string "12.19.1"
npm ERR! gyp verb install installing version: 12.19.1
npm ERR! gyp verb install --ensure was passed, so won't reinstall if already installed
npm ERR! gyp verb install version is already installed, need to check "installVersion"
npm ERR! gyp verb got "installVersion" 9
npm ERR! gyp verb needs "installVersion" 9
npm ERR! gyp verb install version is good
npm ERR! gyp verb get node dir target node version installed: 12.19.1
npm ERR! gyp verb build dir attempting to create "build" dir: C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build
npm ERR! gyp verb build dir "build" dir needed to be created? C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build
npm ERR! gyp verb find VS msvs_version not set from command line or npm config
npm ERR! gyp verb find VS VCINSTALLDIR not set, not running in VS Command Prompt
npm ERR! gyp verb find VS checking VS2017 (15.9.28307.1300) found at:
npm ERR! gyp verb find VS "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools"
npm ERR! gyp verb find VS - found "Visual Studio C++ core features"
npm ERR! gyp verb find VS - found VC++ toolset: v141
npm ERR! gyp verb find VS - found Windows SDK: 10.0.17763.0
npm ERR! gyp info find VS using VS2017 (15.9.28307.1300) 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! gyp verb build/config.gypi creating config file
npm ERR! gyp verb build/config.gypi writing out config file: C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\config.gypi
npm ERR! gyp verb config.gypi checking for gypi file: C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\config.gypi
npm ERR! gyp verb common.gypi checking for gypi file: C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\common.gypi
npm ERR! gyp verb gyp gyp format was not specified; forcing "msvs"
npm ERR! gyp info spawn C:\Users\Paul\.windows-build-tools\python27\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Users\\Paul\\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\\Paul\\Desktop\\Prive\\NodeJS\\Topaz\\node_modules\\canvas\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\Paul\\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\\Paul\\AppData\\Local\\node-gyp\\Cache\\12.19.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\\Paul\\AppData\\Local\\node-gyp\\Cache\\12.19.1',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\Paul\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\Paul\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\12.19.1\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\Paul\\Desktop\\Prive\\NodeJS\\Topaz\\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\\Paul\\Desktop\\Prive\\NodeJS\\Topaz\\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 verb cli [
npm ERR! gyp verb cli   'C:\\Program Files (x86)\\nodejs\\node.exe',
npm ERR! gyp verb cli   'C:\\Users\\Paul\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js',
npm ERR! gyp verb cli   'build',
npm ERR! gyp verb cli   '--fallback-to-build',
npm ERR! gyp verb cli   '--module=C:\\Users\\Paul\\Desktop\\Prive\\NodeJS\\Topaz\\node_modules\\canvas\\build\\Release\\canvas.node',
npm ERR! gyp verb cli   '--module_name=canvas',
npm ERR! gyp verb cli   '--module_path=C:\\Users\\Paul\\Desktop\\Prive\\NodeJS\\Topaz\\node_modules\\canvas\\build\\Release',
npm ERR! gyp verb cli   '--napi_version=7',
npm ERR! gyp verb cli   '--node_abi_napi=napi',
npm ERR! gyp verb cli   '--napi_build_version=0',
npm ERR! gyp verb cli   '--node_napi_label=node-v72'
npm ERR! gyp verb cli ]
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | win32 | ia32
npm ERR! gyp verb command build []
npm ERR! gyp verb build type Release
npm ERR! gyp verb architecture ia32
npm ERR! gyp verb node dev dir C:\Users\Paul\AppData\Local\node-gyp\Cache\12.19.1
npm ERR! gyp verb found first Solution file build/binding.sln
npm ERR! gyp verb using MSBuild: C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe
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   '/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\Paul\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
npm ERR! gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275: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\\Paul\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\Paul\\Desktop\\Prive\\NodeJS\\Topaz\\node_modules\\canvas\\build\\Release\\canvas.node" "--module_name=canvas" "--module_path=C:\\Users\\Paul\\Desktop\\Prive\\NodeJS\\Topaz\\node_modules\\canvas\\build\\Release" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
npm ERR! gyp ERR! cwd C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas
npm ERR! gyp ERR! node -v v12.19.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\Paul\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\build\Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
npm ERR! node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
npm ERR! node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1021:16)
npm ERR! node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286: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\\Paul\\Desktop\\Prive\\NodeJS\\Topaz\\node_modules\\canvas\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"     
npm ERR! node-pre-gyp ERR! cwd C:\Users\Paul\Desktop\Prive\NodeJS\Topaz\node_modules\canvas
npm ERR! node-pre-gyp ERR! node -v v12.19.1
npm ERR! node-pre-gyp ERR! node-pre-gyp -v v0.15.0
npm ERR! node-pre-gyp ERR! not ok
npm verb exit 1
npm timing npm Completed in 10366ms

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Paul\AppData\Local\npm-cache\_logs\2021-03-28T14_59_32_036Z-debug.log

When reading, I found out that I don't have one of the dependencies installed, GTK 2. But here is the problem: I can't install it. When clicking on cairo, then clicking on download and then clicking on official GTK+ for Windows page, I get a 404 not found.

When clicking win32 or win64, it just stops loading after about a second. Anyone hass an idea how I can fix this?

@bug249286
Copy link

node:12.18.1-alpine

Error Message

node-pre-gyp WARN Using needle for node-pre-gyp https download
node-pre-gyp WARN Tried to download(404): https://github.com/Automattic/node-canvas/releases/download/v2.7.0/canvas-v2.7.0-node-v72-linux-musl-x64.tar.gz
node-pre-gyp WARN Pre-built binaries not found for [email protected] and [email protected] (node-v72 ABI, musl) (falling back to source compile with node-gyp)
Package pixman-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing pixman-1.pc' to the PKG_CONFIG_PATH environment variable Package 'pixman-1', required by 'virtual:world', not found gyp: Call to 'pkg-config pixman-1 --libs' returned exit status 1 while in binding.gyp. while trying to load binding.gyp gyp ERR! configure error gyp ERR! stack Error: gypfailed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) gyp ERR! System Linux 4.15.0-106-generic gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/src/app/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/usr/src/app/node_modules/canvas/build/Release" "--napi_version=6" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72" gyp ERR! cwd /usr/src/app/node_modules/canvas gyp ERR! node -v v12.18.1 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 '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/src/app/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/usr/src/app/node_modules/canvas/build/Release --napi_version=6 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/usr/src/app/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:315:20) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:1021:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5) node-pre-gyp ERR! System Linux 4.15.0-106-generic node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/src/app/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /usr/src/app/node_modules/canvas node-pre-gyp ERR! node -v v12.18.1 node-pre-gyp ERR! node-pre-gyp -v v0.15.0 node-pre-gyp ERR! not ok napi_build_version=0 --node_napi_label=node-v72' (1) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] install:node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /.npm/_logs/2021-03-29T06_28_02_393Z-debug.log

@zbjornson
Copy link
Collaborator

@Paultje52 node-canvas doesn't really support 32-bit Node.js unfortunately. To make it work, I think you'd have to compile cairo/pango/etc. for 32-bit Windows. The 32-bit versions of those libraries that I've found online aren't built in a way that's compatible with node-canvas.


@bug249286 please see the musl section of #1511 - prebuilds are only available for glibc.

@Paultje52 Paultje52 changed the title Can't install canav Can't install canas Apr 3, 2021
@Paultje52 Paultje52 changed the title Can't install canas Can't install canvas Apr 3, 2021
@Paultje52
Copy link
Author

Paultje52 commented Apr 3, 2021

@Paultje52 node-canvas doesn't really support 32-bit Node.js unfortunately. To make it work, I think you'd have to compile cairo/pango/etc. for 32-bit Windows. The 32-bit versions of those libraries that I've found online aren't built in a way that's compatible with node-canvas.

I don't think I'm using 32-bit node. How can I check that?

@zbjornson
Copy link
Collaborator

@Paultje52 your install log includes npm ERR! node-pre-gyp info using [email protected] | win32 | ia32 and C:\Program Files (x86)\nodejs\node.exe. 64-bit node would say win32 | x64 and not have (x86) in the path.

@knownasnaffy
Copy link

Can anyone suggest any guide to download node-canvas on windows 32-bit?

@toddhow
Copy link

toddhow commented Apr 23, 2021

I get the same error on x64

@zbjornson
Copy link
Collaborator

The same error cannot happen on x64. Please open a separate issue with the information in the issue template. If you're getting the message fatal error C1083: Cannot open include file: 'cairo.h' then that means you're building from source but don't have the dependencies installed (see https://github.com/Automattic/node-canvas/wiki/Installation:-Windows).

@NingerJohn
Copy link

@Paultje52 Have to ask you, did you solve this problem?

@victorquanlam
Copy link

I have the same problem. Install this npm package is a madness.

@aknkaplanoglu
Copy link

Anyone solved this problem ?

@lengjing
Copy link

@aknkaplanoglu try @napi-rs/canvas?

@lukesyy
Copy link

lukesyy commented Apr 19, 2022

  1. You need download zip: https://iso.mirrors.ustc.edu.cn/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip
  2. Unzip him to C:\GTK
  3. try npm i

@Aabha1
Copy link

Aabha1 commented May 13, 2022

Can anyone suggest any guide to download node-canvas on windows 32-bit?

yes please if someone has found pls guide.

@Aabha1
Copy link

Aabha1 commented May 13, 2022

  1. You need download zip: https://iso.mirrors.ustc.edu.cn/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip
  2. Unzip him to C:\GTK
  3. try npm i

tried this but nothing happened.

@Aabha1
Copy link

Aabha1 commented May 13, 2022

The same error cannot happen on x64. Please open a separate issue with the information in the issue template. If you're getting the message fatal error C1083: Cannot open include file: 'cairo.h' then that means you're building from source but don't have the dependencies installed (see https://github.com/Automattic/node-canvas/wiki/Installation:-Windows).

I followed all steps and installed whatever was required but still this error is popping up again and again.

@wx85745997
Copy link

The same error cannot happen on x64. Please open a separate issue with the information in the issue template. If you're getting the message fatal error C1083: Cannot open include file: 'cairo.h' then that means you're building from source but don't have the dependencies installed (see https://github.com/Automattic/node-canvas/wiki/Installation:-Windows).

I followed all steps and installed whatever was required but still this error is popping up again and again.

work for me.
if you get another error like

Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1

try it.
1.run: npm cache clean --force
2.delete node_modules
3.delete packagelock.json and yarn.lock(if have)
4.run: npm install

@fl0wm0ti0n
Copy link

The same error cannot happen on x64. Please open a separate issue with the information in the issue template. If you're getting the message fatal error C1083: Cannot open include file: 'cairo.h' then that means you're building from source but don't have the dependencies installed (see https://github.com/Automattic/node-canvas/wiki/Installation:-Windows).

I followed all steps and installed whatever was required but still this error is popping up again and again.

work for me. if you get another error like

Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1

try it. 1.run: npm cache clean --force 2.delete node_modules 3.delete packagelock.json and yarn.lock(if have) 4.run: npm install

that did the job! with following before:
You need download zip: https://iso.mirrors.ustc.edu.cn/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip
Unzip him to C:\GTK

Bentroen added a commit to OpenNBS/NoteBlockWorld that referenced this issue Jul 8, 2024
…-rs/canvas`)

Fixes font not rendering on backend due to a bug in node-canvas v2.11.2.
See: Automattic/node-canvas#2285

Couldn't downgrade to v2.10.2 due to build issues on Windows.
See: Automattic/node-canvas#1773 (comment)

R

v3.0.0 of node-canvas will remove node-pre-gyp which should make it a bit easier to install?
See: https://github.com/Automattic/node-canvas/releases/tag/v3.0.0-rc2
@JulianCataldo
Copy link

https://iso.mirrors.ustc.edu.cn/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip

Thanks. I was missing the GTK part. Had to install Python, VS Code + C++ build tools, before GTK.

IDK why it's triggering the compilation instead of just fetching the pre-built, the host machine is a commonly found X86 with Win 11, all with X64 stuff (Node,…)

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