Skip to content

Cannot install in v12.16.3 #1580

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

Closed
Robin-Sch opened this issue May 13, 2020 · 12 comments
Closed

Cannot install in v12.16.3 #1580

Robin-Sch opened this issue May 13, 2020 · 12 comments

Comments

@Robin-Sch
Copy link

Robin-Sch commented May 13, 2020

fatal error C1083: Cannot open include file: 'jpeglib.h' canvas windows

Issue or Feature

PS D:\data\bots\official\Earl> npm i canvas

[email protected] install D:\data\bots\official\Earl\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.
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
D:\data\bots\official\Earl\node_modules\canvas\src\closure.h(6,10): fatal error C1083: Cannot open include file: 'jpeglib.h': No such file or directory (compiling source file ..\src\backend\SvgBac
kend.cc) [D:\data\bots\official\Earl\node_modules\canvas\build\canvas.vcxproj]
CanvasPattern.cc
D:\data\bots\official\Earl\node_modules\canvas\src\closure.h(6,10): fatal error C1083: Cannot open include file: 'jpeglib.h': No such file or directory (compiling source file ..\src\backend\PdfBac
kend.cc) [D:\data\bots\official\Earl\node_modules\canvas\build\canvas.vcxproj]
CanvasRenderingContext2d.cc
D:\data\bots\official\Earl\node_modules\canvas\src\closure.h(6,10): fatal error C1083: Cannot open include file: 'jpeglib.h': No such file or directory (compiling source file ..\src\Canvas.cc) [D:
\data\bots\official\Earl\node_modules\canvas\build\canvas.vcxproj]
closure.cc
color.cc
D:\data\bots\official\Earl\node_modules\canvas\src\closure.h(6,10): fatal error C1083: Cannot open include file: 'jpeglib.h': No such file or directory (compiling source file ..\src\Backends.cc) [
D:\data\bots\official\Earl\node_modules\canvas\build\canvas.vcxproj]
Image.cc
ImageData.cc
init.cc
register_font.cc
win_delay_load_hook.cc
D:\data\bots\official\Earl\node_modules\canvas\src\closure.h(6,10): fatal error C1083: Cannot open include file: 'jpeglib.h': No such file or directory (compiling source file ..\src\closure.cc) [D
:\data\bots\official\Earl\node_modules\canvas\build\canvas.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\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=D:\data\bots\official\Earl\node_modules\canvas\build\Release\canvas.node" "--module_name=canvas" "--module_path=D:\data\bots\official\Earl\node_modules\canvas\build\Release" "--napi_version=5"
"--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd D:\data\bots\official\Earl\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=D:\data\bots\official\Earl\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=D:\data\bots\official\Earl\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. (C:\Users\ytrob\AppData\Roaming\npm\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\ytrob\AppData\Roaming\npm\node_modules\node-pre-gyp\bin\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd D:\data\bots\official\Earl\node_modules\canvas
node-pre-gyp ERR! node -v v12.16.3
node-pre-gyp ERR! node-pre-gyp -v v0.14.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=D:\data\bots\official\Earl\node_modules\canvas\build\Release\canvas.node --module_name=canvas --module_path=D:\data\bots\official\Earl\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 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\ytrob\AppData\Roaming\npm-cache_logs\2020-05-13T21_03_55_413Z-debug.log

Steps to Reproduce

npm install canvas

Your Environment

  • node: v12.16.3, npm: 6.14.4
  • Windows 10

Solved: #1580 (comment)

@zbjornson
Copy link
Collaborator

Hit error Remote end closed socket abruptly.

Can you try again once or twice please? I hit this a few times last night. It seems like GitHub release assets might be having some service issues.

@Robin-Sch
Copy link
Author

node-pre-gyp WARN Hit error Remote end closed socket abruptly.

Still

@Robin-Sch
Copy link
Author

image

I deleted manually the c:\libjpeg-turbo-gcc folder, which causes this. Maybe this is the problem?

@zbjornson
Copy link
Collaborator

zbjornson commented May 14, 2020

See also #1573 - this is an upstream issue with Node.js/needle (tomas/needle#312)

Renamed the issue for better visibility to other users.

@zbjornson zbjornson changed the title fatal error C1083: Cannot open include file: 'jpeglib.h' canvas windows Cannot install in v12.16.3 May 14, 2020
@lhcdims
Copy link

lhcdims commented May 16, 2020

same problem, any work around? thanks

@zbjornson
Copy link
Collaborator

@lhcdims check out #1573 for a work around (install request)

@lhcdims
Copy link

lhcdims commented May 17, 2020

@zbjornson thanks, I got it, and I write it down here for others that may have the same problem:

  1. install 'n', which is a node version manager:
    sudo npm install n -g

  2. use 'n' to install and use node version 12.13.1:
    n 12.13.1

  3. Go to your node.js project directory, and use node version 12.13.1 to install canvas:
    npm i canvas --save

@neumartin
Copy link

Hi!, I faced the same issue in Ubuntu 20.04 with latest Node.
When change the node version to 12.13.1 works fine.
How can we use this library with the latest node version to take adventages of new fixes and improvements?

Thanks!

@Dusty211
Copy link

@zbjornson Your workaround worked for me. I used nvm instead of n, and that did the trick as well.

@Robin-Sch
Copy link
Author

Indead #1580 (comment) worked.

@neumartin
Copy link

@RobinSchapendonk why you close this issue?, can I use node 12.16.3 with this library?
Thanks!

@Dusty211
Copy link

Dusty211 commented May 20, 2020

@neumartin To answer your second question: As long as you switch to Node 12.13.1 before you run 'npm install canvas', you can switch back to 12.16.3 afterwards. It's not ideal, but seems to work OK for now. Not sure why the closed it. Obviously this is a temporary workaround and not a fix. I have to use a 12.16.3 environment, so this is my best option.

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

5 participants