neplextech / canvacord

Easily generate images using react-like components in nodejs. Canvacord is suitable for creating dynamic images such as social media posts, greetings cards, memes, etc. It is also possible to create your own templates and builders to generate images. You are only limited by your imagination.
https://canvacord.neplex.dev
GNU General Public License v3.0
259 stars 74 forks source link

[BUG] Fails to install on Windows 10 #96

Closed L1lith closed 3 years ago

L1lith commented 3 years ago

Describe the bug

To Reproduce Steps to reproduce the behavior:

npm install canvacord

Expected behavior I expected the library to install successfully

Terminal Logs

PS C:\Users\MYUSER\Projects\test\canvatest> npm install canvacord

> canvas@2.8.0 install C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas
> node-pre-gyp install --fallback-to-build

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-v83-win32-unknown-ia32.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for canvas@2.8.0 and node@14.15.5 (node-v83 ABI, unknown) (falling back to source compile with node-gyp)
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-v83-win32-unknown-ia32.tar.gz
Warning: Missing input files:
C:\GTK\bin\libpangoft2-1.0-0.dll
C:\GTK\bin\zlib1.dll
C:\GTK\bin\libintl-8.dll
C:\GTK\bin\libgmodule-2.0-0.dll
C:\GTK\bin\libglib-2.0-0.dll
C:\GTK\bin\libexpat-1.dll
C:\GTK\bin\libpng14-14.dll
C:\GTK\bin\libcairo-2.dll
C:\GTK\bin\libfontconfig-1.dll
C:\GTK\bin\libgobject-2.0-0.dll
C:\GTK\bin\libgthread-2.0-0.dll
C:\GTK\bin\libpangocairo-1.0-0.dll
C:\GTK\bin\libfreetype-6.dll
C:\GTK\bin\libpango-1.0-0.dll
C:\GTK\bin\libpangowin32-1.0-0.dll
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  Backend.cc
  ImageBackend.cc
  PdfBackend.cc
  SvgBackend.cc
  BMPParser.cc
  Backends.cc
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\backend\backend.h(3): fatal error C1083: Cannot open include file: 'cairo.h': No such file o
r directory (compiling source file ..\src\backend\Backend.cc) [C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\canvas.vcxproj]
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\backend\backend.h(3): fatal error C1083: Cannot open include file: 'cairo.h': No such file o
r directory (compiling source file ..\src\backend\PdfBackend.cc) [C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\canvas.vcxproj]
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\backend\backend.h(3): fatal error C1083: Cannot open include file: 'cairo.h': No such file o
r directory (compiling source file ..\src\backend\SvgBackend.cc) [C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\canvas.vcxproj]
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\backend\backend.h(3): fatal error C1083: Cannot open include file: 'cairo.h': No such file o
r directory (compiling source file ..\src\backend\ImageBackend.cc) [C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\canvas.vcxproj]
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\backend\backend.h(3): fatal error C1083: Cannot open include file: 'cairo.h': No such file o
r directory (compiling source file ..\src\Backends.cc) [C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\canvas.vcxproj]
  Canvas.cc
  CanvasGradient.cc
  CanvasPattern.cc
  CanvasRenderingContext2d.cc
  closure.cc
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\bmp\bmpparser.cc(186): warning C4018: '>': signed/unsigned mismatch [C:\Users\MYUSER\Projects\
test\canvatest\node_modules\canvas\build\canvas.vcxproj]
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\bmp\bmpparser.cc(201): warning C4018: '>': signed/unsigned mismatch [C:\Users\MYUSER\Projects\
test\canvatest\node_modules\canvas\build\canvas.vcxproj]
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\backend\backend.h(3): fatal error C1083: Cannot open include file: 'cairo.h': No such file o
r directory (compiling source file ..\src\Canvas.cc) [C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\canvas.vcxproj]
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\backend\backend.h(3): fatal error C1083: Cannot open include file: 'cairo.h': No such file o
r directory (compiling source file ..\src\closure.cc) [C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\canvas.vcxproj]
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\canvasrenderingcontext2d.h(5): fatal error C1083: Cannot open include file: 'cairo.h': No su
ch file or directory (compiling source file ..\src\CanvasRenderingContext2d.cc) [C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\canvas.vc
xproj]
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\canvaspattern.h(5): fatal error C1083: Cannot open include file: 'cairo.h': No such file or 
directory (compiling source file ..\src\CanvasPattern.cc) [C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\canvas.vcxproj]
  color.cc
  Image.cc
  ImageData.cc
  init.cc
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\image.h(5): fatal error C1083: Cannot open include file: 'cairo.h': No such file or director
y (compiling source file ..\src\Image.cc) [C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\canvas.vcxproj]
  register_font.cc
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\register_font.h(3): fatal error C1083: Cannot open include file: 'pango/pango.h': No such fi
le or directory (compiling source file ..\src\register_font.cc) [C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\canvas.vcxproj]
  win_delay_load_hook.cc
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\init.cc(4): fatal error C1083: Cannot open include file: 'pango/pango.h': No such file or di
rectory [C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\canvas.vcxproj]
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\canvasgradient.h(7): fatal error C1083: Cannot open include file: 'cairo.h': No such file or
 directory (compiling source file ..\src\CanvasGradient.cc) [C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\canvas.vcxproj]
c:\users\MYUSER\projects\test\canvatest\node_modules\canvas\src\util.h(31): error C2039: 'toupper': is not a member of 'std' (compiling source file ..\src\I
mageData.cc) [C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\canvas.vcxproj]
  c:\program files (x86)\microsoft visual studio\2017\buildtools\vc\tools\msvc\14.16.27023\include\queue(451): note: see declaration of 'std' (compiling s
  ource file ..\src\ImageData.cc)
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Windows_NT 10.0.17763
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" "build" "--fallback-to-build" "--module=C:\\Users\\MYUSER\\Projects\\test\\canvatest\\node_modules\\canvas\\build\\Release\\canvas.node" "--module_name=canvas" "--module_path=C:\\Users\\MYUSER\\Projects\\test\\canvatest\\node_modules\\canvas\\build\\Release" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas
gyp ERR! node -v v14.15.5
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 build --fallback-to-build --module=C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\MYUSER\Projects\test\canvatest\node_modules\@mapbox\node-pre-gyp\lib\util\compile.js:89:23)node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1048: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.17763
node-pre-gyp ERR! command "C:\\Program Files (x86)\\nodejs\\node.exe" "C:\\Users\\MYUSER\\Projects\\test\\canvatest\\node_modules\\@mapbox\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas
node-pre-gyp ERR! node -v v14.15.5
node-pre-gyp ERR! node-pre-gyp -v v1.0.5
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 build --fallback-to-build --module=C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\MYUSER\Projects\test\canvatest\node_modules\canvas\build\Release --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm WARN canvatest@1.0.0 No description
npm WARN canvatest@1.0.0 No repository field.

Please complete the following information:

sujalgoel commented 3 years ago

To install node-canvas or canvacord:

twlite commented 3 years ago

We are moving to @napi-rs/canvas from node-canvas in the next version. Hopefully this issue will be fixed then. For current version, you need to follow node-canvas installation process

sujalgoel commented 3 years ago

You can close the issue if your issue is resolved.