node-rsvg icon indicating copy to clipboard operation
node-rsvg copied to clipboard

Installation fail in node v0.11.16, v0.12.1

Open mori-dev opened this issue 9 years ago • 9 comments

I can install librsvg in node v0.10.36. But I cannnot install in node v0.11.16 and v0.12.1. How to install rsvg in node v0.11.16 and v0.12.1?

gyp ERR! stack Error: `make` failed with exit code: 2
child_process: customFds option is deprecated, use stdio instead.
  CXX(target) Release/obj.target/rsvg/src/Rsvg.o
In file included from ../src/Rsvg.cc:2:
../src/Rsvg.h:7:27: error: expected class name
class Rsvg : public node::ObjectWrap {
                          ^
../src/Rsvg.h:15:41: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
        static v8::Handle<v8::Value> New(const v8::Arguments& args);
                                               ^~~~~~~~~~~~~
                                               v8::internal::Arguments
/Users/b05997/.node-gyp/0.12.1/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
In file included from ../src/Rsvg.cc:2:
../src/Rsvg.h:16:48: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
        static v8::Handle<v8::Value> GetBaseURI(const v8::Arguments& args);
                                                      ^~~~~~~~~~~~~
v8::internal::Arguments

...

/Users/b05997/.node-gyp/0.12.1/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here
class Arguments;
      ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [Release/obj.target/rsvg/src/Rsvg.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/b05997/.nodebrew/node/v0.12.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1067:12)
gyp ERR! System Darwin 14.1.0
gyp ERR! command "node" "/Users/b05997/.nodebrew/node/v0.12.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/b05997/repos/fam/fam-image-server/node_modules/rsvg
gyp ERR! node -v v0.12.1
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok
npm ERR! Darwin 14.1.0
npm ERR! argv "/Users/b05997/.nodebrew/node/v0.12.1/bin/node" "/Users/b05997/.nodebrew/current/bin/npm" "install" "rsvg"
npm ERR! node v0.12.1
npm ERR! npm  v2.5.1
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the rsvg 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 rsvg
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/b05997/repos/fam/fam-image-server/npm-debug.log

mori-dev avatar Apr 10 '15 02:04 mori-dev

Seems to be an issue with the changes of node 0.12: https://strongloop.com/strongblog/node-js-v0-12-c-apis-breaking/

Apparently usage of nan would fix that. Update would be much appreciated!

deyhle avatar May 06 '15 14:05 deyhle

PRs accepted! I could possibly take a look at nanifying the code, if I have time the coming month.

walling avatar May 28 '15 17:05 walling

:pray:

mori-dev avatar May 29 '15 01:05 mori-dev

Recently tried to make a port using nan: https://github.com/heilage-nsk/node-rsvg/tree/port-to-node-0.12 - current status is "works for me", tested on node 0.10.37 and 0.12.4.

Based on this fork: https://github.com/anru/node-rsvg/ Made a PR: https://github.com/anru/node-rsvg/pull/1 - some code review would be much appreciated.

ctizen avatar Jun 05 '15 07:06 ctizen

Just tried librsvg from git instead of rsvg, and it works like a charm even in Node/io.js 2.2.1! :yellow_heart:

ricordisamoa avatar Jun 05 '15 13:06 ricordisamoa

Any update on this getting fixed?

ali-habibzadeh avatar Aug 05 '15 16:08 ali-habibzadeh

I'm sorry I haven't been able to keep up with the issues in this project and unfortunately I must confess it's not super high priority for me right now compared to some other things. It seems the fork of @anru works quite well right now.

If anyone wants commit access to this repo to make it up-to-date, please send a private message. Otherwise, I'll see if I can back port the changes from anru’s fork in a few months.

walling avatar Aug 05 '15 16:08 walling

npm install librsvg per @ricordisamoa's comment worked for me!

cp avatar Nov 10 '15 02:11 cp

For now, librsvg npm package is up-to-date and points to a maintained fork of node-rsvg at https://github.com/2gis/node-rsvg that supports nodejs up to 5.x.

ctizen avatar Nov 10 '15 03:11 ctizen