jieter/leaflet-headless

Error installing leaflet headless

hcphoon01 opened this issue · 3 comments

I'm trying to use this module in a project I am making but I'm struggling to install it. I am running a windows 10 laptop with node v10.15.3 and python v2.7 (as I've seen its required by this module). But when I do npm i leaflet-headless I get this error

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
  Canvas.cc
  CanvasGradient.cc
  CanvasPattern.cc
  CanvasRenderingContext2d.cc
  color.cc
  Image.cc
  ImageData.cc
  init.cc
  win_delay_load_hook.cc
c:\users\harry\documents\projects\discordbot\node_modules\leaflet-headless\node_modules\canvas\src\canvas.h(19): fatal error C1083: Cannot open include fi
le: 'cairo.h': No such file or directory (compiling source file ..\src\ImageData.cc) [C:\Users\Harry\Documents\Projects\DiscordBot\node_modules\leaflet-he
adless\node_modules\canvas\build\canvas.vcxproj]
c:\users\harry\documents\projects\discordbot\node_modules\leaflet-headless\node_modules\canvas\src\canvas.h(19): fatal error C1083: Cannot open include fi 
le: 'cairo.h': No such file or directory (compiling source file ..\src\Canvas.cc) [C:\Users\Harry\Documents\Projects\DiscordBot\node_modules\leaflet-headl
ess\node_modules\canvas\build\canvas.vcxproj]
c:\users\harry\documents\projects\discordbot\node_modules\leaflet-headless\node_modules\canvas\src\canvas.h(19): fatal error C1083: Cannot open include fi 
le: 'cairo.h': No such file or directory (compiling source file ..\src\CanvasPattern.cc) [C:\Users\Harry\Documents\Projects\DiscordBot\node_modules\leafle 
t-headless\node_modules\canvas\build\canvas.vcxproj]
c:\users\harry\documents\projects\discordbot\node_modules\leaflet-headless\node_modules\canvas\src\canvas.h(19): fatal error C1083: Cannot open include fi 
le: 'cairo.h': No such file or directory (compiling source file ..\src\CanvasGradient.cc) [C:\Users\Harry\Documents\Projects\DiscordBot\node_modules\leafl 
et-headless\node_modules\canvas\build\canvas.vcxproj]
c:\users\harry\documents\projects\discordbot\node_modules\leaflet-headless\node_modules\canvas\src\canvas.h(19): fatal error C1083: Cannot open include fi 
le: 'cairo.h': No such file or directory (compiling source file ..\src\Image.cc) [C:\Users\Harry\Documents\Projects\DiscordBot\node_modules\leaflet-headle 
ss\node_modules\canvas\build\canvas.vcxproj]
c:\users\harry\documents\projects\discordbot\node_modules\leaflet-headless\node_modules\canvas\src\canvas.h(19): fatal error C1083: Cannot open include fi 
le: 'cairo.h': No such file or directory (compiling source file ..\src\init.cc) [C:\Users\Harry\Documents\Projects\DiscordBot\node_modules\leaflet-headles 
s\node_modules\canvas\build\canvas.vcxproj]
c:\users\harry\documents\projects\discordbot\node_modules\leaflet-headless\node_modules\canvas\src\canvas.h(19): fatal error C1083: Cannot open include fi 
le: 'cairo.h': No such file or directory (compiling source file ..\src\CanvasRenderingContext2d.cc) [C:\Users\Harry\Documents\Projects\DiscordBot\node_mod 
ules\leaflet-headless\node_modules\canvas\build\canvas.vcxproj]
gyp ERR! build error 
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:189:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Windows_NT 10.0.18362
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Harry\Documents\Projects\DiscordBot\node_modules\leaflet-headless\node_modules\canvas
gyp ERR! node -v v10.15.3
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok 
npm WARN discord.js@11.5.1 requires a peer of @discordjs/uws@^10.149.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of bufferutil@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of erlpack@discordapp/erlpack but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of libsodium-wrappers@^0.7.3 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of node-opus@^0.2.7 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of opusscript@^0.0.6 but none is installed. You must install peer dependencies yourself.
npm WARN discord.js@11.5.1 requires a peer of sodium@^2.0.3 but none is installed. You must install peer dependencies yourself.
npm WARN discordbot@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@1.6.13 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.6.13 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!     C:\Users\Harry\AppData\Roaming\npm-cache\_logs\2019-10-13T09_56_12_164Z-debug.log

I have tried installing canvas by itself and that works it just does not seem to like to install leaflet headless.

Downgrade to note 10. The canvas@1.6.3 dependency doesn't work with node 12.

Is there any way around that as some of my dependencies require node 12 + @matthewdolman