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

node-gyp rebuild fails on my system #625

Closed
thinsoldier opened this issue Sep 11, 2015 · 16 comments
Closed

node-gyp rebuild fails on my system #625

thinsoldier opened this issue Sep 11, 2015 · 16 comments

Comments

@thinsoldier
Copy link

npm ERR! Failed at the canvas@1.2.8 install script 'node-gyp rebuild'.
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-gyp rebuild
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! Please include the following file with any support request:

@LinusU
Copy link
Collaborator

LinusU commented Sep 14, 2015

I can't see whats wrong from that output. Could you please clone this repo and run npm install?

@ericandrewlewis
Copy link

I also got this error, with the following output

  CXX(target) Release/obj.target/canvas/src/CanvasRenderingContext2d.o
  CXX(target) Release/obj.target/canvas/src/color.o
  CXX(target) Release/obj.target/canvas/src/Image.o
  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
../src/FontFace.cc:9:10: fatal error: 'fontconfig/fontconfig.h' file not found
#include <fontconfig/fontconfig.h>
         ^
1 error generated.
make: *** [Release/obj.target/canvas/src/FontFace.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2

@LinusU
Copy link
Collaborator

LinusU commented Sep 16, 2015

Do you have fontconfig installed?

@ericandrewlewis
Copy link

I should note I ran the install script first, as suggested in the Mac OSX installation instructions.

I'm not sure if I have fontconfig installed. I tried installing it with brew and get this error:

$ brew install fontconfig
==> Downloading https://homebrew.bintray.com/bottles/fontconfig-2.11.1.yosemite.bottle.3.tar.gz
######################################################################## 100.0%
==> Pouring fontconfig-2.11.1.yosemite.bottle.3.tar.gz
==> /usr/local/Cellar/fontconfig/2.11.1/bin/fc-cache -frv
-frv

dyld: Library not loaded: /usr/local/lib/libfreetype.6.dylib
  Referenced from: /usr/local/Cellar/fontconfig/2.11.1/bin/fc-cache
  Reason: Incompatible library version: fc-cache requires version 18.0.0 or later, but libfreetype.6.dylib provides version 16.0.0
Warning: The post-install step did not complete successfully
You can try again using `brew postinstall fontconfig`
==> Summary
🍺  /usr/local/Cellar/fontconfig/2.11.1: 448 files, 3.6M

@thinsoldier
Copy link
Author

I can't see whats wrong from that output. Could you please clone this repo and run npm install?

[$]> git clone https://github.com/Automattic/node-canvas.git
[$]> cd node-canvas/
[$]> npm install
/

canvas@1.2.9 install /Applications/XAMPP/xamppfiles/htdocs/_experiments/node-canvas/node-canvas
node-gyp rebuild

./util/has_cairo_freetype.sh: line 4: pkg-config: command not found
gyp: Call to './util/has_cairo_freetype.sh' returned exit status 0. 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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Applications/XAMPP/xamppfiles/htdocs/_experiments/node-canvas/node-canvas
gyp ERR! node -v v0.12.4
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok

npm ERR! Darwin 14.5.0
npm ERR! argv "node" "/usr/local/bin/npm" "install"
npm ERR! node v0.12.4
npm ERR! npm v2.10.1
npm ERR! code ELIFECYCLE
npm ERR! canvas@1.2.9 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the canvas@1.2.9 install script 'node-gyp rebuild'.
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-gyp rebuild
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! Please include the following file with any support request:
npm ERR! /Applications/XAMPP/xamppfiles/htdocs/_experiments/node-canvas/node-canvas/npm-debug.log

@LinusU
Copy link
Collaborator

LinusU commented Sep 16, 2015

This is the problem

pkg-config: command not found

You need pkg-config installed.

@thinsoldier
Copy link
Author

Thanks

brew install pkg-config
brew install cairo
npm install canvas

Lots of warnings but no errors.

Now if only I could remember why the #$!@*% I was trying to install these things to begin with :'(

@ericandrewlewis
Copy link

Should leave this open while the documented and scripted install process doesn't work

@thinsoldier thinsoldier reopened this Sep 16, 2015
@thinsoldier
Copy link
Author

:(

Example code from readme doesn't seem to work properly for me.

http://i.imgur.com/veu0MSj.png

@LinusU
Copy link
Collaborator

LinusU commented Sep 16, 2015

Might be related to #628

@Greenycath
Copy link

I have the same error as before so after the install pkg-config

gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/greenycath/.nvm/v4.1.0/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.10.0-123.8.1.el7.x86_64
gyp ERR! command "/home/greenycath/.nvm/v4.1.0/bin/node" "/home/greenycath/.nvm/v4.1.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/greenycath/node_modules/canvas
gyp ERR! node -v v4.1.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 
npm ERR! Linux 3.10.0-123.8.1.el7.x86_64
npm ERR! argv "/home/greenycath/.nvm/v4.1.0/bin/node" "/home/greenycath/.nvm/v4.1.0/bin/npm" "install" "canvas"
npm ERR! node v4.1.0
npm ERR! npm  v2.14.3
npm ERR! code ELIFECYCLE

npm ERR! canvas@1.2.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the canvas@1.2.9 install script 'node-gyp rebuild'.
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-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls canvas
npm ERR! There is likely additional logging output above.

@LinusU
Copy link
Collaborator

LinusU commented Sep 19, 2015

@Greenycath That log doesn't contain enough info to debug. Could you please clone this repo and run npm install?

@Greenycath
Copy link

@LinusU

$ git clone https://github.com/Automattic/node-canvas.git
Cloning into 'node-canvas'...
remote: Counting objects: 5429, done.
remote: Total 5429 (delta 0), reused 0 (delta 0), pack-reused 5429
Receiving objects: 100% (5429/5429), 2.61 MiB | 1.82 MiB/s, done.
Resolving deltas: 100% (3769/3769), done.
$ cd node-canvas/
$ npm install
/
> canvas@1.2.9 install /home/greenycath/node-canvas
> node-gyp rebuild

make: Вход в каталог[enter catalog] `/home/greenycath/node-canvas/build'
  SOLINK_MODULE(target) Release/obj.target/canvas-postbuild.node
make: g++: Команда не найдена[command not found]
make: *** [Release/obj.target/canvas-postbuild.node] Ошибка 127[error 127]
make: Выход из каталога[exit catalog] `/home/greenycath/node-canvas/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.10.0-123.8.1.el7.x86_64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/greenycath/node-canvas
gyp ERR! node -v v4.1.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok 

npm ERR! Linux 3.10.0-123.8.1.el7.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install"
npm ERR! node v4.1.0
npm ERR! npm  v2.14.3
npm ERR! code ELIFECYCLE
npm ERR! canvas@1.2.9 install: `node-gyp rebuild`
npm ERR! Exit status 1

@LinusU
Copy link
Collaborator

LinusU commented Sep 21, 2015

It seems like you don't have g++ installed. Are you on Ubuntu? Try sudo apt-get install build-essentials.

@Greenycath
Copy link

@LinusU
No, on Centos 7, there is no g++ package in repos. However, I've installed gcc-c++ and the problem is solved (except one worrying:
../src/Image.cc:655:13: предупреждение[worrying]: «void jpeg_mem_src(j_decompress_ptr, void_, long int)» определена, но нигде не используется[defined but is not used] [-Wunused-function]
static void jpeg_mem_src (j_decompress_ptr cinfo, void_ buffer, long nbytes) {
^
)
Thank U!

@LinusU
Copy link
Collaborator

LinusU commented Feb 15, 2016

The installation script have been retired and we have new instructions on the start page...

Closing this since it's an old thread, please see our new installation instructions and report back if you still have problems...

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