You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yes it was installed via brew, and it does exist at that location: /usr/local/include
Should the npm install be looking there?
Im on 10.9 which might not be helping things...
Fixed!
I seemed to have missed any warning about Xcode Command Tools, and was certain that Cairo had successfully installed where maybe it hadnt. I'd reinstalled it a number of times without any warnings.
The errors I was getting didnt mention anything about this, however it was this that fixed the issue, so I would double check you have this installed correctly.
Reacted by Adam Hanna, Patrick Gunderson, jared laser, Tomek Nieżurawski, Eamonn Comerford, bear001, Alex Nisnevich, mengsina2014, cherry-geqi, Homer Chen and 4 more
Reacted by bins and Trevor Suna
Reacted by Won Jun Bae, DC, Fernando Arévalo, mengsina2014, bins, Trevor Suna and YuanPei Li
I had the same problem. Found this post. Wrote 'xcode-select --install'
in terminal and installed xcode command line tools via the prompt
retried npm install canvas and it worked directly without issues and without reinstalling cairo via homebrew. so many thanks @georgecoltart
I had the same problem, and I have long searched on the internet, but nothing has solved the problem. But now with brew uninstall jpeg && brew install jpeg it finally worked. jpeg was indeed installed before, but apparently there was a mistake. Thanks @mojodna
My fork download all dependencies and compike them statically inside the canvas.node binary, so these problems are not happening anymore. I did a pull-request sometime ago.
Activity
sethfitz commentedon Oct 26, 2013
jpeglib.his in/usr/local/includeon my system, having been installed viabrew install jpeg. How did you install it?georgecoltart commentedon Oct 26, 2013
Yes it was installed via brew, and it does exist at that location: /usr/local/include
Should the npm install be looking there?
Im on 10.9 which might not be helping things...
sethfitz commentedon Oct 26, 2013
I just upgraded from 10.7 to 10.9, so I'm trying to reproduce.
npm install cairodidn't work out of the box (where it previously did), even withPKG_CONFIGset. So far, I've done the following:I didn't do anything with
jpeghere, but you might have better luckbrew uninstall jpeg && brew install jpegfirst...georgecoltart commentedon Oct 26, 2013
Fixed!
I seemed to have missed any warning about Xcode Command Tools, and was certain that Cairo had successfully installed where maybe it hadnt. I'd reinstalled it a number of times without any warnings.
O well thanks a lot!
justnolanzh commentedon Nov 11, 2013
I also encountered this problem, no solution
georgecoltart commentedon Nov 11, 2013
If you are on Mavericks, you'll need to install the Xcode command line tools, even if you did it on mountain lion.
See top answer here: http://stackoverflow.com/questions/9329243/xcode-4-4-and-later-install-command-line-tools
The errors I was getting didnt mention anything about this, however it was this that fixed the issue, so I would double check you have this installed correctly.
justnolanzh commentedon Nov 11, 2013
I'm on Mavericks. Thanks a lot , I have solved.
ajatolah commentedon Mar 5, 2014
I had the same problem, yhostc's solution solved it, thank you
davidrinnan commentedon Apr 29, 2014
I had the same problem. Found this post. Wrote 'xcode-select --install'
in terminal and installed xcode command line tools via the prompt
retried npm install canvas and it worked directly without issues and without reinstalling cairo via homebrew. so many thanks @georgecoltart
soyuka commentedon Aug 29, 2014
Thanks @yhostc!
xcode-select --installdid the trick. I think this comes from my recent migration to Mavericks.My steps were:
see #14123 for the pkgconfig
This should definitely be added to the wiki.
nodecode commentedon Sep 29, 2014
I had the same problem, and I have long searched on the internet, but nothing has solved the problem. But now with
brew uninstall jpeg && brew install jpegit finally worked.jpegwas indeed installed before, but apparently there was a mistake. Thanks @mojodnapiranna commentedon Sep 30, 2014
I'm having the same problem, but in this case in Ubuntu 14.10, not on OSX... :-(
PaulMougel commentedon Oct 1, 2014
Here's how I fixed it:
$ xcode-select --install $ export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/opt/X11/lib/pkgconfig $ npm installdosapati commentedon Mar 27, 2015
Had the same issue, yhostc's solution solved it, thank you
yaserabdelaziz commentedon Jul 9, 2015
No one of these solutions helped in my case, but this helped fix it :
https://gist.github.com/darul75/9125097
piranna commentedon Aug 9, 2015
I think node-canvas should download the dependencies and compile them statically to prevent this problems...
Drjacky commentedon Oct 18, 2015
What about in ubuntu?!
piranna commentedon Oct 18, 2015
My fork download all dependencies and compike them statically inside the canvas.node binary, so these problems are not happening anymore. I did a pull-request sometime ago.
dbkaplun commentedon Oct 23, 2015
+1
lizhanhui commentedon Dec 15, 2015
For Ubuntu users, please install the package: libjpeg-dev
It works for Wily(15.04 64bit).
0326 commentedon Jan 21, 2016
$ xcode-select --install works for mac!
tomerb15 commentedon Jan 24, 2016
I did a lot of the things writen here for my mac OSX but non seam to work.
Finally i uninstalled node-canvas from my node_modules library and reinstall it and now i can work with jpegs!
I feel like i have won a gold medal at the Olympics
whxaxes commentedon Feb 1, 2016
great !!!!!!!!! xcode-select --install works
thanks a lot
LinusU commentedon Feb 15, 2016
Please try
xcode-select --install:)piranna commentedon Feb 15, 2016
As I said before, by compiling statically this problem gets fixed. My pull-request is waiting...
zhaotai commentedon May 10, 2016
My solution is the same with @LinusU.
Just
xcode-select --install.javadba commentedon Apr 23, 2017
xcode-select --install works for me.