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

Installation Issue #1573

Closed
nobu-sh opened this issue May 6, 2020 · 13 comments
Closed

Installation Issue #1573

nobu-sh opened this issue May 6, 2020 · 13 comments

Comments

@nobu-sh
Copy link

nobu-sh commented May 6, 2020

I have been attempting for a while now with no success, I was able to install canvas perfectly fine before I reset my pc due to some issues, now whenever I attempt to Install Canvas I get this error.

Issue or Feature


C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU>npm i [email protected]

> [email protected] install C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v72 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Hit error Remote end closed socket abruptly.
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v72 ABI, unknown) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Hit error ENOENT: Cannot cd into 'C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\Release'
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
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
  Canvas.cc
  CanvasGradient.cc
  CanvasPattern.cc
  CanvasRenderingContext2d.cc
  closure.cc
  color.cc
  Image.cc
  ImageData.cc
  init.cc
  register_font.cc
  Backend.cc
  ImageBackend.cc
  PdfBackend.cc
  SvgBackend.cc
  BMPParser.cc
  Backends.cc
  Canvas.cc
  CanvasGradient.cc
  CanvasPattern.cc
  CanvasRenderingContext2d.cc
  closure.cc
  color.cc
  Image.cc
  ImageData.cc
  init.cc
  register_font.cc
  win_delay_load_hook.cc
c:\users\logan\desktop\tamuro u serenity stuff\serenity ++\testbot uwu\node_modules\canvas\src\closure.h(6): fatal error C1083: Cannot open include file: 'jpeglib.h': No su
ch file or directory (compiling source file ..\src\backend\PdfBackend.cc) [C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\ 
canvas.vcxproj]
c:\users\logan\desktop\tamuro u serenity stuff\serenity ++\testbot uwu\node_modules\canvas\src\closure.h(6): fatal error C1083: Cannot open include file: 'jpeglib.h': No su
ch file or directory (compiling source file ..\src\Backends.cc) [C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\canvas.vcx 
proj]
  win_delay_load_hook.cc
c:\users\logan\desktop\tamuro u serenity stuff\serenity ++\testbot uwu\node_modules\canvas\src\closure.h(6): fatal error C1083: Cannot open include file: 'jpeglib.h': No su
ch file or directory (compiling source file ..\src\backend\SvgBackend.cc) [C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\ 
canvas.vcxproj]
c:\users\logan\desktop\tamuro u serenity stuff\serenity ++\testbot uwu\node_modules\canvas\src\closure.h(6): fatal error C1083: Cannot open include file: 'jpeglib.h': No su
c:\users\logan\desktop\tamuro u serenity stuff\serenity ++\testbot uwu\node_modules\canvas\src\closure.h(6): fatal error C1083: Cannot open include file: 'jpeglib.h': No su
ch file or directory (compiling source file ..\src\backend\PdfBackend.cc) [C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\
canvas.vcxproj]
ch file or directory (compiling source file ..\src\Canvas.cc) [C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\canvas.vcxpr 
oj]
c:\users\logan\desktop\tamuro u serenity stuff\serenity ++\testbot uwu\node_modules\canvas\src\closure.h(6): fatal error C1083: Cannot open include file: 'jpeglib.h': No su
ch file or directory (compiling source file ..\src\backend\SvgBackend.cc) [C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\ 
canvas.vcxproj]
c:\users\logan\desktop\tamuro u serenity stuff\serenity ++\testbot uwu\node_modules\canvas\src\closure.h(6): fatal error C1083: Cannot open include file: 'jpeglib.h': No su 
ch file or directory (compiling source file ..\src\Backends.cc) [C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\canvas.vcx 
proj]
c:\users\logan\desktop\tamuro u serenity stuff\serenity ++\testbot uwu\node_modules\canvas\src\closure.h(6): fatal error C1083: Cannot open include file: 'jpeglib.h': No su
ch file or directory (compiling source file ..\src\closure.cc) [C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\canvas.vcxp
roj]
c:\users\logan\desktop\tamuro u serenity stuff\serenity ++\testbot uwu\node_modules\canvas\src\closure.h(6): fatal error C1083: Cannot open include file: 'jpeglib.h': No su
ch file or directory (compiling source file ..\src\Canvas.cc) [C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\canvas.vcxpr 
oj]
c:\users\logan\desktop\tamuro u serenity stuff\serenity ++\testbot uwu\node_modules\canvas\src\closure.h(6): fatal error C1083: Cannot open include file: 'jpeglib.h': No su
ch file or directory (compiling source file ..\src\closure.cc) [C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\canvas.vcxp 
roj]
C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\src\CanvasRenderingContext2d.cc : fatal error C1083: Cannot open compiler generat
ed file: 'C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\Release\obj\canvas\CanvasRenderingContext2d.obj': Permission deni
ed [C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\canvas.vcxproj]
cl : Command line error D8040: error creating or communicating with child process [C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canva
s\build\canvas.vcxproj]
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\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:310:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Windows_NT 10.0.18363
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\Logan\\Desktop\\Tamuro u serenity stuff\\Serenity ++\\testbot UwU\\node_modules\\canvas\\build\\Release\\canvas.node" "--module_name=canvas" "--module_path=C:\\Users\\Logan\\Desktop\\Tamuro u serenity stuff\\Serenity ++\\testbot UwU\\node_modules\\canvas\\build\\Release" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas
gyp ERR! node -v v12.16.3
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\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\Release --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:310: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 Windows_NT 10.0.18363
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Logan\\Desktop\\Tamuro u serenity stuff\\Serenity ++\\testbot UwU\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas
node-pre-gyp ERR! node -v v12.16.3
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=C:\Users\Logan\Desktop\Tamuro u serenity stuff\Serenity ++\testbot UwU\node_modules\canvas\build\Release --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)    
npm WARN [email protected] No description
npm WARN [email protected] No repository field.

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!     C:\Users\Logan\AppData\Roaming\npm-cache\_logs\2020-05-06T03_54_06_840Z-debug.log

A Little More Info

I never used to go through an install process like this before either, it would just install like any other package.
Before this error started happening though. It essentially said it could not find visual studio code. So I installed the launcher than installed the build pack than I started getting this issue.

All in all I have become very confused because before I reset my pc I did not have to go through all this process to install canvas.

Your Environment

npm version 6.14.4
Visual Studio Code (just the one from their website, it really has no year)
Windows 10 Home

@nobu-sh nobu-sh closed this as completed May 6, 2020
@Uninvited6766
Copy link

Hello! Did you fix this error? I am having the same issue and haven't found a solution yet.

@harlos0517
Copy link

Could you please explain how you fixed this issue? I am also having the same issue.

@daviddavid
Copy link

I'm getting the same error. It seems like it can't find the prebuilt binary for [email protected] (node-v72). However, looking at the releases, there's a binary for canvas-v2.6.1 @ node-v72. So I'm not sure why it's not picking it up.

I went back to node v12.13.1 and it installed without problems.

@PilHliP211
Copy link

@ShinobisSneaky can you fill us in on how you fixed the problem? thanks!

@zbjornson
Copy link
Collaborator

This seems to be this issue tracked in needle: tomas/needle#312

@nobu-sh
Copy link
Author

nobu-sh commented May 15, 2020

sorry everyone for not responding, my problem was I had a version of node that just released that day so canvas packages were not updated for this version. One thing I found that helps if you have this problem when you are building your app is add the package "cairo" in the package.json file. I am not 100% how it fixed it but once I added the build would succeed.

@PilHliP211 @DeemoHarlos @Uninvited6766 @daviddavid

@lhcdims
Copy link

lhcdims commented May 15, 2020

'cairo' added in package.json:

"cairo": "0.1.0-alpha.2",

However, npm i canvas still got error:

$ npm i canvas

> [email protected] install /home/lichiukenneth/nodejs/node-webrtc-examples/node_modules/canvas
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp WARN Pre-built binaries not installable for [email protected] and [email protected] (node-v72 ABI, glibc) (falling back to source compile with node-gyp) 
node-pre-gyp WARN Hit error Remote end closed socket abruptly. 
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
No package 'pixman-1' 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: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:310:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Linux 5.3.0-51-generic
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/home/lichiukenneth/nodejs/node-webrtc-examples/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/home/lichiukenneth/nodejs/node-webrtc-examples/node_modules/canvas/build/Release" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /home/lichiukenneth/nodejs/node-webrtc-examples/node_modules/canvas
gyp ERR! node -v v12.16.3
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/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/lichiukenneth/nodejs/node-webrtc-examples/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/lichiukenneth/nodejs/node-webrtc-examples/node_modules/canvas/build/Release --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/lichiukenneth/nodejs/node-webrtc-examples/node_modules/canvas/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:310: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 5.3.0-51-generic
node-pre-gyp ERR! command "/usr/bin/node" "/home/lichiukenneth/nodejs/node-webrtc-examples/node_modules/canvas/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/lichiukenneth/nodejs/node-webrtc-examples/node_modules/canvas
node-pre-gyp ERR! node -v v12.16.3
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok 
Failed to execute '/usr/bin/node /usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/home/lichiukenneth/nodejs/node-webrtc-examples/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/home/lichiukenneth/nodejs/node-webrtc-examples/node_modules/canvas/build/Release --napi_version=5 --node_abi_napi=napi --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!     /home/lichiukenneth/.npm/_logs/2020-05-15T14_22_35_109Z-debug.log

@zbjornson
Copy link
Collaborator

zbjornson commented May 15, 2020

node-pre-gyp (the package that is attempting to download prebuilds) will use request instead of needle if it's installed, so you could install that first to work around the bug in needle that I linked to above.

One thing I found that helps if you have this problem when you are building your app is add the package "cairo" in the package.json file.

I don't think that will help. It looks like something to do with React. https://www.npmjs.com/package/cairo

@nobu-sh
Copy link
Author

nobu-sh commented May 15, 2020

Yeah I did not believe cairo would help but it is kind of weird, when I was deploying my app to Heroku, Canvas would constantly fail to build, than I added cairo I do not remember my reasoning behind it, but after I did that the build deployed successfully. I am not very knowledgeable in this stuff.

@marcosflick
Copy link

Installing the cairo package did not work for me.

Could this issue be investigated further?

@Uninvited6766
Copy link

Uninvited6766 commented May 20, 2020 via email

@zbjornson
Copy link
Collaborator

@marcosflick @Uninvited6766 see the top entry in #1511 or my comments above:

Installation fails with Node.js v12.16.3 and later

This is due to an upstream issue in the module that downloads prebuilds: tomas/needle#312. That issue will hopefully be fixed today, 20-May.

Workarounds:

  • Add request to your package.json. node-pre-gyp will automatically use that instead of needle.
  • Use an earlier version of Node.js
  • Build from source (see readme)

@SBRK
Copy link

SBRK commented Jul 21, 2020

This was helpful ^

PSA: the problem is still happening today. I'm on node 14.5 and the install was failing until I added request to my dependencies

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

9 participants