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

HTTP 404 for node-canvas-prebuilt/releases/download/v2.0.0-alpha.10 #1111

Closed
huan opened this issue Mar 9, 2018 · 19 comments
Closed

HTTP 404 for node-canvas-prebuilt/releases/download/v2.0.0-alpha.10 #1111

huan opened this issue Mar 9, 2018 · 19 comments

Comments

@huan
Copy link

huan commented Mar 9, 2018

node-pre-gyp ERR! stack Error: 404 status code downloading tarball https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.0.0-alpha.10/canvas-prebuilt-v2.0.0-alpha.10-node-v59-linux-x64.tar.gz

$ npm i canvas@2.0.0-alpha.10

> canvas@2.0.0-alpha.10 install /home/zixia/git/node-facenet/node_modules/canvas
> node-pre-gyp install

node-pre-gyp ERR! install error 
node-pre-gyp ERR! stack Error: 404 status code downloading tarball https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.0.0-alpha.10/canvas-prebuilt-v2.0.0-alpha.10-node-v59-linux-x64.tar.gz
node-pre-gyp ERR! stack     at Request.<anonymous> (/home/zixia/git/node-facenet/node_modules/node-pre-gyp/lib/install.js:118:27)
node-pre-gyp ERR! stack     at Request.emit (events.js:132:15)
node-pre-gyp ERR! stack     at Request.onRequestResponse (/home/zixia/git/node-facenet/node_modules/node-pre-gyp/node_modules/request/request.js:1074:10)
node-pre-gyp ERR! stack     at ClientRequest.emit (events.js:127:13)
node-pre-gyp ERR! stack     at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:539:21)
node-pre-gyp ERR! stack     at HTTPParser.parserOnHeadersComplete (_http_common.js:117:17)
node-pre-gyp ERR! stack     at TLSSocket.socketOnData (_http_client.js:444:20)
node-pre-gyp ERR! stack     at TLSSocket.emit (events.js:127:13)
node-pre-gyp ERR! stack     at addChunk (_stream_readable.js:269:12)
node-pre-gyp ERR! stack     at readableAddChunk (_stream_readable.js:256:11)
node-pre-gyp ERR! System Linux 4.13.0-36-generic
node-pre-gyp ERR! command "/usr/bin/node" "/home/zixia/git/node-facenet/node_modules/.bin/node-pre-gyp" "install"
node-pre-gyp ERR! cwd /home/zixia/git/node-facenet/node_modules/canvas
node-pre-gyp ERR! node -v v9.7.1
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok 
404 status code downloading tarball https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.0.0-alpha.10/canvas-prebuilt-v2.0.0-alpha.10-node-v59-linux-x64.tar.gz

Issue or Feature

Steps to Reproduce

npm i canvas@2.0.0-alpha.10

Your Environment

  • Version of node-canvas (e.g. 1.4.0): 2.0.0-alpha.10
  • Environment (e.g. node 4.2.0 on Mac OS X 10.8): Ubuntu 17.10
@LinusU
Copy link
Collaborator

LinusU commented Mar 9, 2018

I've just released canvas@2.0.0-alpha.11 which falls backs to building from source, it should work as before 👍

@huan
Copy link
Author

huan commented Mar 9, 2018

Linux works now, but Darwin not! :P

See:

download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.0.0-alpha.11/canvas-prebuilt-v2.0.0-alpha.11-node-v59-darwin-x64.tar.gz

node-pre-gyp install --fallback-to-build
node-pre-gyp ERR! Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.0.0-alpha.11/canvas-prebuilt-v2.0.0-alpha.11-node-v59-darwin-x64.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for canvas@2.0.0-alpha.11 and node@9.8.0 (node-v59 ABI, unknown) (falling back to source compile with node-gyp) 
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp ERR! configure error 
gyp ERR! stack Error: Python executable "/usr/local/bin/python" is v3.6.4, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at PythonFinder.failPythonVersion (/Users/travis/.nvm/versions/node/v9.8.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:492:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/Users/travis/.nvm/versions/node/v9.8.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:474:14)
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:265:7)
gyp ERR! stack     at ChildProcess.emit (events.js:180:13)
gyp ERR! stack     at maybeClose (internal/child_process.js:936:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:353:11)
gyp ERR! stack     at Socket.emit (events.js:180:13)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:538:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/Users/travis/.nvm/versions/node/v9.8.0/bin/node" "/Users/travis/.nvm/versions/node/v9.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/Users/travis/build/zixia/node-facenet/node_modules/canvas/build/Release/canvas-prebuilt.node" "--module_name=canvas-prebuilt" "--module_path=/Users/travis/build/zixia/node-facenet/node_modules/canvas/build/Release"
gyp ERR! cwd /Users/travis/build/zixia/node-facenet/node_modules/canvas
gyp ERR! node -v v9.8.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/travis/.nvm/versions/node/v9.8.0/bin/node /Users/travis/.nvm/versions/node/v9.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/Users/travis/build/zixia/node-facenet/node_modules/canvas/build/Release/canvas-prebuilt.node --module_name=canvas-prebuilt --module_path=/Users/travis/build/zixia/node-facenet/node_modules/canvas/build/Release' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/travis/build/zixia/node-facenet/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:180:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:936:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
node-pre-gyp ERR! System Darwin 16.7.0

@LinusU
Copy link
Collaborator

LinusU commented Mar 9, 2018

That seems like a problem with your build setup. Unfortunately it's quite complicated to install Node.js native addons 😞

gyp ERR! stack Error: Python executable "/usr/local/bin/python" is v3.6.4, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.

@huan
Copy link
Author

huan commented Mar 9, 2018

Yes, I saw the Python3 problem.

However there's still a 404 error above, I believe we are missing the file https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.0.0-alpha.11/canvas-prebuilt-v2.0.0-alpha.11-node-v59-darwin-x64.tar.gz too.

@LinusU
Copy link
Collaborator

LinusU commented Mar 9, 2018

Yeah, we currently don't have an automatic way of creating prebuilts...

It would be nice if TravisCI/CircleCI could do that 😄

@chearon
Copy link
Collaborator

chearon commented Mar 9, 2018

Like a way to trigger node-gfx/node-canvas-prebuilt or do you want them to happen in the node-canvas Travis? It does take a lot of customizations / scripts.

I bet we could set something up that triggers a canvas-prebuilt release when you push a version number change, but you'd still want to wait a bit before npm publish

@huan
Copy link
Author

huan commented Mar 9, 2018

@chearon @LinusU I can't agree anymore, let's setup CI to do create prebuilt automatically. 👍

@LinusU
Copy link
Collaborator

LinusU commented Mar 9, 2018

I think you can set travis to trigger builds whenever a tag that matches vX.X.X is created 🤔

@binbinlau
Copy link

binbinlau commented Mar 15, 2018

maybe you can try 'npm i canvas@2.0.0-alpha.1'. @zixia

@cristianodp
Copy link

Hello everyone, I have de the problem reported by Zixia. Is there any solution or alternative way install canvas?

@chearon
Copy link
Collaborator

chearon commented Mar 21, 2018

@cristianodp I'm updating the binaries now but you may need to install a different version as described above

I think you can set travis to trigger builds whenever a tag that matches vX.X.X is created 🤔

@LinusU yeah, but I think doing it that way would mean we have to move the node-canvas-prebuilt stuff to this repo. It has to

  • Build the Linux release in a Docker container
  • Use 3 different scripts to bundle dependencies for each platform
  • Currently the Windows build builds off of Msys2
  • Uses customized binding.gyp files

I'm just not sure we want to add all of that to the canvas repo or not, but we totally could. I could get rid of the last bullet, but the rest would be a bunch of new files/build steps.

The easiest path forward that I can think of is create some kind of release script that invokes canvas-prebuilt CI servers.

@zbjornson
Copy link
Collaborator

I think doing it that way would mean we have to move the node-canvas-prebuilt stuff to this repo ...

We can install a github hook that triggers whatever we need -- e.g. it could trigger running the release script. Might be something like [github hook for tag] -> [Cloud Function that kicks-off stuff] -> [docker builds].

@LinusU
Copy link
Collaborator

LinusU commented Mar 21, 2018

Uses customized binding.gyp files

Are these any changes that would be nice to upstream here anyways? Could be a good first step :)

@chearon
Copy link
Collaborator

chearon commented Mar 22, 2018

If I remember correctly I had to modify the Linux build so the binary looks in its own dir for dependencies. Could do that in "release mode" with a CLI argument. And the Windows build has a heavily modified GYP file so that it can build off of MSYS. That would probably involve some directory searching similar to what we already do to find libraries, so yeah, could be beneficial here.

Then we need:

  • Node iteration, which could be done by prebuild or by node-canvas-prebuilt scripts
  • Bundling, which would all have to be moved over from node-canvas-prebuilt
  • Releasing to GitHub, can move the zero-dependency release.js from node-canvas-prebuilt

So it'd take some time, but might be nice to have it all here

@chearon chearon closed this as completed Mar 22, 2018
@chearon chearon reopened this Mar 22, 2018
@chearon
Copy link
Collaborator

chearon commented Mar 26, 2018

All binaries through alpha 12 are finally live.

@chearon chearon closed this as completed Mar 26, 2018
@marcsyp
Copy link

marcsyp commented Apr 22, 2018

Hi all, I'm a bit of a n00b with docker containers, and I'm receiving a similar error using canvas@2.0.0-alpha.12

My amateur debugging sense tells me that perhaps the prebuilt binary for my combination of canvas + node does not exist. Is there a way for me to downgrade my node to a specific version to enable me to build my docker container? (It was building fine with canvas 1.X).

Thanks,
Marc

ERROR MSG:

CXX(target) Release/obj.target/canvas/src/ImageData.o
CXX(target) Release/obj.target/canvas/src/init.o
CXX(target) Release/obj.target/canvas/src/FontFace.o
SOLINK_MODULE(target) Release/obj.target/canvas.node
COPY Release/canvas.node
make: Leaving directory '/node_modules/text2png/node_modules/canvas/build'

canvas@2.0.0-alpha.12 install /node_modules/canvas
node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/node-gfx/node-canvas-prebuilt/releases/download/v2.0.0-alpha.12/canvas-prebuilt-v2.0.0-alpha.12-node-v59-linux-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for canvas@2.0.0-alpha.12 and node@9.11.1 (node-v59 ABI, glibc) (falling back to source compile with node-gyp)
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: gypfailed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16) gyp ERR! stack at ChildProcess.emit (events.js:180:13) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12) gyp ERR! System Linux 4.9.87-linuxkit-aufs gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/node_modules/canvas/build/Release/canvas-prebuilt.node" "--module_name=canvas-prebuilt" "--module_path=/node_modules/canvas/build/Release" "--napi_version=3" "--node_abi_napi=napi" gyp ERR! cwd /node_modules/canvas gyp ERR! node -v v9.11.1 gyp ERR! node-gyp -v v3.6.2 gyp ERR! not ok node-pre-gyp ERR! build error node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/node_modules/canvas/build/Release/canvas-prebuilt.node --module_name=canvas-prebuilt --module_path=/node_modules/canvas/build/Release --napi_version=3 --node_abi_napi=napi' (1) node-pre-gyp ERR! stack at ChildProcess.<anonymous> (/node_modules/node-pre-gyp/lib/util/compile.js:83:29) node-pre-gyp ERR! stack at ChildProcess.emit (events.js:180:13) node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:936:16) node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5) node-pre-gyp ERR! System Linux 4.9.87-linuxkit-aufs node-pre-gyp ERR! command "/usr/local/bin/node" "/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" node-pre-gyp ERR! cwd /node_modules/canvas node-pre-gyp ERR! node -v v9.11.1 node-pre-gyp ERR! node-pre-gyp -v v0.9.1 node-pre-gyp ERR! not ok Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/node_modules/canvas/build/Release/canvas-prebuilt.node --module_name=canvas-prebuilt --module_path=/node_modules/canvas/build/Release --napi_version=3 --node_abi_napi=napi' (1) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! canvas@2.0.0-alpha.12 install:node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@2.0.0-alpha.12 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! /root/.npm/_logs/2018-04-22T04_28_19_176Z-debug.log
The command '/bin/sh -c npm install --production' returned a non-zero code: 1

@marcsyp
Copy link

marcsyp commented Apr 22, 2018

Incidentally, I was able to solve this build error by downgrading to canvas-2.0.0-alpha.11 (didn't work) and then downgrading my Dockerfile node image reference to Node:8. Hopefully this is helpful for anyone else having similar issues.

Q: My container is linux and I am doing dev testing in Node 9.7.1 in Windows. Are there any issues with the changes above that I should be aware of?

Thanks!

Marc

@chearon
Copy link
Collaborator

chearon commented Apr 23, 2018

Probably the binary didn't download because of node-gfx/node-canvas-prebuilt#35.

That's not an error, though, since it will continue to build, which is where your real errors are:

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
...

@marcsyp
Copy link

marcsyp commented Apr 23, 2018

Interesting -- thanks for the tip... not sure how to do that though, with the pre-built docker container template I am using (I was using Node:9 until downgrading to Node:8 solved my problem, but would be happy to go back to 9). Any tips/links for adding that PKG_CONFIG_PATH variable, finding the right path value, etc?

Thanks!
Marc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants