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

Not installing on Ubuntu 11.04 #113

Closed
adamjv90 opened this issue Aug 23, 2011 · 8 comments
Closed

Not installing on Ubuntu 11.04 #113

adamjv90 opened this issue Aug 23, 2011 · 8 comments

Comments

@adamjv90
Copy link

From a clean install this was my prep:

sudo apt-get install build-essential
sudo apt-get install libssl-dev
sudo apt-get install libcairo2-dev libjpeg8-dev

also install most current version of node and npm exactly how instructions tell you to.

when trying to install i get this:

Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /home/ubuntu/local/node
Checking for library gif : not found
Checking for library jpeg : yes
Checking for cairo : yes
'configure' finished successfully (0.275s)
Waf: Entering directory /home/ubuntu/local/node/lib/node_modules/canvas/build' [1/9] cxx: src/CanvasRenderingContext2d.cc -> build/default/src/CanvasRenderingContext2d_1.o [2/9] cxx: src/CanvasGradient.cc -> build/default/src/CanvasGradient_1.o ../src/CanvasRenderingContext2d.cc: In constructor ‘Context2d::Context2d(Canvas*)’: ../src/CanvasRenderingContext2d.cc:128:25: warning: converting to non-pointer type ‘short int’ from NULL [3/9] cxx: src/PixelArray.cc -> build/default/src/PixelArray_1.o [4/9] cxx: src/color.cc -> build/default/src/color_1.o ../src/color.cc:189:1: warning: converting to non-pointer type ‘uint32_t’ from NULL [5/9] cxx: src/Canvas.cc -> build/default/src/Canvas_1.o ../src/Canvas.cc: In static member function ‘static v8::Handle<v8::Value> Canvas::ToBuffer(const v8::Arguments&)’: ../src/Canvas.cc:201:73: error: invalid conversion from ‘int (*)(eio_req*)’ to ‘void (*)(eio_req*)’ ../src/Canvas.cc:201:73: error: initializing argument 1 of ‘eio_req* eio_custom(void (*)(eio_req*), int, int (*)(eio_req*), void*)’ Waf: Leaving directory/home/ubuntu/local/node/lib/node_modules/canvas/build'
Build failed: -> task failed (err #1):
{task: cxx Canvas.cc -> Canvas_1.o}
npm ERR! error installing canvas@0.7.0 Error: canvas@0.7.0 preinstall: node-waf configure build
npm ERR! error installing canvas@0.7.0 sh "-c" "node-waf configure build" failed with 1
npm ERR! error installing canvas@0.7.0 at ChildProcess. (/home/ubuntu/local/node/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing canvas@0.7.0 at ChildProcess.emit (events.js:70:17)
npm ERR! error installing canvas@0.7.0 at ChildProcess.onexit (child_process_legacy.js:246:12)
npm ERR! canvas@0.7.0 preinstall: node-waf configure build
npm ERR! sh "-c" "node-waf configure build" failed with 1
npm ERR!
npm ERR! Failed at the canvas@0.7.0 preinstall script.
npm ERR! This is most likely a problem with the canvas package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-waf configure build
npm ERR! You can get their info via:
npm ERR! npm owner ls canvas
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.38-8-virtual
npm ERR! command "node" "/home/ubuntu/local/node/bin/npm" "install" "-g" "canvas"
npm ERR! cwd /home/ubuntu
npm ERR! node -v v0.5.5-pre
npm ERR! npm -v 1.0.26
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/ubuntu/npm-debug.log
npm not ok

@tritonrc
Copy link
Contributor

See #109 (Whoops too quick on the draw here as you clearly installed libjpeg8-dev)

@enobrev
Copy link

enobrev commented Sep 21, 2011

Obviously not a permanent solution, but I found undoing the changes from this commit allows a proper install.

@wallat
Copy link

wallat commented Sep 21, 2011

I met this problem on Ubuntu 11.04, too. How to solve it?

@enobrev
Copy link

enobrev commented Sep 21, 2011

I was wrong. Reverting that specific commit did allow npm to install node-canvas, but it still chokes when trying to use the library as build/default is not there.

Here's what I get when I try to node-waf configure build:

Checking for program g++ or c++          : /usr/bin/g++ 
Checking for program cpp                 : /usr/bin/cpp 
Checking for program ar                  : /usr/bin/ar 
Checking for program ranlib              : /usr/bin/ranlib 
Checking for g++                         : ok  
Checking for node path                   : ok /usr/local/bin/node 
Checking for node prefix                 : ok /usr/local 
Checking for library gif                 : yes 
Checking for library jpeg                : yes 
Checking for cairo                       : yes 
'configure' finished successfully (0.352s)
Waf: Entering directory `/home/ubuntu/server/montage/node_modules/canvas/build'
[1/9] cxx: src/Canvas.cc -> build/Release/src/Canvas_1.o
[2/9] cxx: src/ImageData.cc -> build/Release/src/ImageData_1.o
[3/9] cxx: src/CanvasRenderingContext2d.cc -> build/Release/src/CanvasRenderingContext2d_1.o
../src/CanvasRenderingContext2d.cc: In constructor ‘Context2d::Context2d(Canvas*)’:
../src/CanvasRenderingContext2d.cc:128:25: warning: converting to non-pointer type ‘short int’ from NULL
[4/9] cxx: src/Image.cc -> build/Release/src/Image_1.o
[5/9] cxx: src/PixelArray.cc -> build/Release/src/PixelArray_1.o
[6/9] cxx: src/CanvasGradient.cc -> build/Release/src/CanvasGradient_1.o
[7/9] cxx: src/init.cc -> build/Release/src/init_1.o
[8/9] cxx: src/color.cc -> build/Release/src/color_1.o
../src/color.cc:189:1: warning: converting to non-pointer type ‘uint32_t’ from NULL
[9/9] cxx_link: build/Release/src/Canvas_1.o build/Release/src/ImageData_1.o build/Release/src/CanvasRenderingContext2d_1.o build/Release/src/Image_1.o build/Release/src/PixelArray_1.o build/Release/src/CanvasGradient_1.o build/Release/src/init_1.o build/Release/src/color_1.o -> build/Release/canvas.node
Waf: Leaving directory `/home/ubuntu/server/montage/node_modules/canvas/build'
'build' finished successfully (3.387s)

The [9/9] line is in orange.

I'm using node v0.5.8-pre (have tried previous versions back to v0.5.3) on Ubuntu 11.04 (amd64).

@enobrev
Copy link

enobrev commented Sep 21, 2011

I found the last part of the problem. I reverted to 0.7.2 and then installed via npm. Finally, in node_modules/canvas/lib/canvas.js, it looks for the Canvas objects built from node-waf in build/default on line 12:

var canvas = require('../build/default/canvas')

But the build puts everything in build/Release. So due to time contraints, instead of updating the require in the actual code and potentially breaking other things, I copied build/Release to build/default. That's all it took. Canvas works for me now.

Good luck!

@dominictarr
Copy link

this failed for me too, I had to install libcairo2-devel libjpeg8-dev and then I got a new error about gif_lib.h ... installed giflib5 manually http://sourceforge.net/projects/giflib/files/giflib-5.x/
but then got a runtime error: could not find libgif.so.6. This file was actually in /usr/local/lib I just copied it into /usr/lib and now it's working.

It sure would be nice if node-canvas bundled it's deps or you could put them on npm or something.

@rvagg
Copy link
Contributor

rvagg commented Apr 9, 2014

The problem with the deps here is that they are huge. You've seen the complaints about the leveldown compile time, that's nothing compared to the problem scale here.

What we ought to do is experiment with getting it all bundled with node-pre-gyp so we can distribute platform - suitable binaries. Glibc versions on Linux make it tricky but arguably it's Linux users that have the easiest time installing deps and compiling anyway.

@LinusU
Copy link
Collaborator

LinusU commented Feb 15, 2016

Closing this since we aren't using node-waf anymore...

@LinusU LinusU closed this as completed Feb 15, 2016
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

8 participants