Orion98MC / node_rrd

A node.js native binding for RRDtool (node rrd)
97 stars 25 forks source link

Error when running "npm install ." #5

Open larsenglund opened 10 years ago

larsenglund commented 10 years ago

So, since my attempts to get this running on windows went unanswered I set up an Ubuntu box and did as the README suggested (git clone and then npm install .). But I get this error:

> node-gyp rebuild

make: Entering directory `/home/lars/node_rrd/build'
  CXX(target) Release/obj.target/rrd_bindings/src/node_rrd_create.o
../src/node_rrd_create.cc: In function ‘v8::Handle<v8::Value> node_rrd::create(const v8::Arguments&)’:
../src/node_rrd_create.cc:76:79: error: invalid conversion from ‘void (*)(uv_work_t*) {aka void (*)(uv_work_s*)}’ to ‘uv_after_work_cb {aka void (*)(uv_work_s*, int)}’ [-fpermissive]
In file included from /home/lars/.node-gyp/0.10.18/src/node.h:61:0,
                 from ../src/node_rrd.h:28,
                 from ../src/node_rrd_create.cc:27:
/home/lars/.node-gyp/0.10.18/deps/uv/include/uv.h:1432:15: error:   initializing argument 4 of ‘int uv_queue_work(uv_loop_t*, uv_work_t*, uv_work_cb, uv_after_work_cb)’ [-fpermissive]
make: *** [Release/obj.target/rrd_bindings/src/node_rrd_create.o] Error 1
make: Leaving directory `/home/lars/node_rrd/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.8.0-30-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/lars/node_rrd
gyp ERR! node -v v0.10.18
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0

Looks like an error in your code?

Orion98MC commented 10 years ago

So, it seems to me they may have changed few things to UV without telling me first :) Which version of ubuntu are you dealing with? Tell you what, I have to setup a new server this week with Ubuntu 13.04 and node 0.10.18. So I will likely hit the same issue if ever. I will then create a new branch on node_rrd where I will patch the module to be in sync with the new uv API changes.

larsenglund commented 10 years ago

Yeah, I actually fixed that when compiling for windows but when I ran into it again under linux, expecting a butter smooth installation and not knowing if there would be more hurdles waiting behind the first, I thought I'd better raise an issue for it. I'm running Ubuntu 13.04 and node 0.10.18. Is there any way I could sweet talk you into publishing this to the npm registry as a public module? It's so nice just to be able to write "rrdtool" : "latest" in the package.json and have it install with all other dependencies with a simple "node install". There are already two other modules in the npm registry that provide an interface to the rrdtool binary (https://npmjs.org/package/rrd and https://npmjs.org/package/node-rrdtool) but your solution seems more efficient and beautiful! (and documented!) :)

Orion98MC commented 10 years ago

Sure, I'm planning on releasing it to npm but I need to settle down the API which is not optimal at this point. I'm open to any suggestions. Also I had a hard time working with node-gyp and I'm fearing the next confrontation ;) Anyways, I'll keep you updated on the uv fix (likely, later this week).

Orion98MC commented 10 years ago

Ok Larse, now you should be able to pull master and compile the module like a charm.

larsenglund commented 10 years ago

Hi, thanks for the quick fix! I found out that npm supports github urls in the package.json dependencies so I happily added

"rrd": "https://github.com/Orion98MC/node_rrd.git"

but I get this error when running "npm install"

npm http 200 https://github.com/Orion98MC/node_rrd.git
npm ERR! not a package /home/lars/tmp/npm-21591-SZpa3MkK/1379271961858-0.45833545620553195/tmp.tgz
npm ERR! Error: ENOENT, open '/home/lars/tmp/npm-21591-SZpa3MkK/1379271961858-0.45833545620553195/package/package.json'
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <npm-@googlegroups.com>

npm ERR! System Linux 3.8.0-30-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/lars/huset/nodejs
npm ERR! node -v v0.10.18
npm ERR! npm -v 1.3.8
npm ERR! path /home/lars/tmp/npm-21591-SZpa3MkK/1379271961858-0.45833545620553195/package/package.json
npm ERR! code ENOENT
npm ERR! errno 34

Any idea what is going on here? I looked in the folder /home/lars/tmp/npm-21591-SZpa3MkK/1379271961858-0.45833545620553195/package/ and the only thing there is a file called index.js that contains the html-code for https://github.com/Orion98MC/node_rrd

larsenglund commented 10 years ago

Nevermind, I just missed that the github url had to start with git:// instead of https:// - problem solved!