Closed ar065 closed 4 years ago
1878 verbose stack at EventEmitter.<anonymous> (/home/gitpod/.nvm/versions/node/v12.16.3/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
1878 verbose stack at EventEmitter.emit (events.js:310:20)
1878 verbose stack at ChildProcess.<anonymous> (/home/gitpod/.nvm/versions/node/v12.16.3/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
1878 verbose stack at ChildProcess.emit (events.js:310:20)
1878 verbose stack at maybeClose (internal/child_process.js:1021:16)
1878 verbose stack at Process.ChildProcess._handle.onexit (internal/
@wolfy01 Can you confirm this being the same issue on your end?
@Kreyren I don't think mine even got that far
@wolfy01 Provide more informations on what is the issue then so that i can provide a better help :p
kreyren likes logs and short videos with the issue
gitpod /workspace $ npm i canvas
> canvas@2.6.1 install /workspace/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 canvas@2.6.1 and node@12.16.3 (node-v72 ABI, glibc) (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 canvas@2.6.1 and node@12.16.3 (node-v72 ABI, glibc) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error ENOENT: Cannot cd into '/workspace/node_modules/canvas/build/Release'
Package pangocairo was not found in the pkg-config search path.
Perhaps you should add the directory containing `pangocairo.pc'
to the PKG_CONFIG_PATH environment variable
No package 'pangocairo' found
gyp: Call to 'pkg-config pangocairo --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 (/home/gitpod/.nvm/versions/node/v12.16.3/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 4.14.138+
gyp ERR! command "/home/gitpod/.nvm/versions/node/v12.16.3/bin/node" "/home/gitpod/.nvm/versions/node/v12.16.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/workspace/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/workspace/node_modules/canvas/build/Release" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /workspace/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 '/home/gitpod/.nvm/versions/node/v12.16.3/bin/node /home/gitpod/.nvm/versions/node/v12.16.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/workspace/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/workspace/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> (/workspace/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 4.14.138+
node-pre-gyp ERR! command "/home/gitpod/.nvm/versions/node/v12.16.3/bin/node" "/workspace/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /workspace/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 '/home/gitpod/.nvm/versions/node/v12.16.3/bin/node /home/gitpod/.nvm/versions/node/v12.16.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/workspace/node_modules/canvas/build/Release/canvas.node --module_name=canvas --module_path=/workspace/node_modules/canvas/build/Release --napi_version=5 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v72' (1)
sh: 0: getcwd() failed: No such file or directorynvas@2.6.1~install: Failed to exec install script
gyp: Call to 'node ./util/has_lib.js jpeg' returned exit status 0 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 (/home/gitpod/.nvm/versions/node/v12.16.3/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 4.14.138+
gyp ERR! command "/home/gitpod/.nvm/versions/node/v12.16.3/bin/node" "/home/gitpod/.nvm/versions/node/v12.16.3/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/workspace/node_modules/canvas/build/Release/canvas.node" "--module_name=canvas" "--module_path=/workspace/node_modules/canvas/build/Release" "--napi_version=5" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v72"
gyp ERR! cwd /workspace/node_modules/canvas
gyp ERR! node -v v12.16.3
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/workspace/package.json'
npm WARN workspace No description
npm WARN workspace No repository field.
npm WARN workspace No README data
npm WARN workspace No license field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! canvas@2.6.1 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@2.6.1 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/gitpod/.npm/_logs/2020-05-16T20_26_10_591Z-debug.log
@Kreyren Is there any other information I should provide?
@wolfy01 append this to your dockerfile and see if that resolves the issue:
RUN true \
&& apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
@wolfy01 report back if it does seems that canvas needs libcairo2-dev
and lib-pango1.0-dev
on ubuntu to build successfully.
@Kreyren I'm sorry but how should I append that to my dockerfile?
@wolfy01 You need to have a file .gitpod.yml
in the root of your repository that has:
image:
file: path/to/dockerfile
where path/to/dockerfile should point to a dockerfile within your repository with a content like:
FROM gitpod/workspace-full
USER root
RUN true \
&& apt-get install -y build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev
Alternatively if you do NOT have a .gitpod.yml
in your repository you can use gp init
in gitpod which is going to generate it for you.
EDIT: gp init
is not going to generate the expected content you still need to append it in .gitpod.Dockerfile
See https://github.com/RXT0112/Zernit/blob/master/.gitpod.yml#L2 and https://github.com/RXT0112/Zernit/blob/master/gitpod/debian.Dockerfile for real-life example
EDIT: Typo
@wolfy01 Does that make sense? O.o
@Kreyren Yea, that makes sense. Thanks... sorry for the late response
@Kreyren Also that didn't seem to work?
Also that didn't seem to work? @wolfy01
Provide an output from npm i canvas
on gitpod with requested change.
Also try
RUN true \
&& apt-get update \
&& apt-get install -y apt-utils \
&& apt-get install -y \
libcairo2-dev \
libpango1.0-dev \
node-nan \
node-gyp \
libjpeg-dev \
libgif-dev \
librsvg2-dev
Seems that node-nan
and node-gyp
are also required
Which seems to work for me, see https://github.com/gitpod-io/workspace-images/pull/232#issuecomment-629709606
Example configuration on https://gitpod.io/#https://github.com/Kreyren/gitpod-1520
UPDATE: nevermind that is not enough, checking why assuming it worked yesterday O.o
@wolfy01 EDIT:
This works for me https://github.com/Kreyren/gitpod-1520/blob/master/.gitpod.Dockerfile, concluded that canvas
needs build-essential libcairo2-dev libpango1.0-dev libjpeg8-dev libgif-dev librsvg2-dev
packages on gitpod's ubuntu to install successfully.
Merge request submitted https://github.com/gitpod-io/workspace-images/pull/232 so you can wait for it to be merged or append these packages to your dockerfile.
@wolfy01 See https://github.com/gitpod-io/workspace-images/pull/232#commitcomment-39238318 seems that you only need to add request
and node-pre-gyp
dependency to your package.json
.
Closing as not-our-bug assuming this seemingly (and based on info from upstream) being an issue with npm dependencies where canvas
requires deprecated request
and node-pre-gyp
to install, let me know if the issue still persist, if so i will reopen ^-^
Also note that according to upstream (https://github.com/Automattic/node-canvas/pull/1582#issuecomment-629837503)
Installing request is a temporary workaround until needle fixes their upstream bug (https://github.com/tomas/needle/issues/312).
@Kreyren Alright, thanks!
Describe the bug
Cannot install the npm
canvas
module.Steps to reproduce
npm i canvas
Expected behavior
Expected canvas to be installed successfully.