npm install fails building inotify
I'm not sure if this is a node-dev issue or a inotify issue?
$ npm install dev -g
[email protected] install /Users/dale/local/node/lib/node_modules/dev/node_modules/inotify 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 : not found
Checking for node prefix : ok /Users/dale/local/node
Checking for program node : /Users/dale/local/node/bin/node
Checking for function inotify_init : not found
'configure' finished successfully (0.845s)
Waf: Entering directory /Users/dale/local/node/lib/node_modules/dev/node_modules/inotify/build' [1/3] cxx: src/bindings.cc -> build/default/src/bindings_1.o [2/3] cxx: src/node_inotify.cc -> build/default/src/node_inotify_1.o In file included from ../src/bindings.h:4, from ../src/bindings.cc:2: ../src/node_inotify.h:7:25: error: sys/inotify.h: No such file or directory In file included from ../src/bindings.h:4, from ../src/node_inotify.cc:2: ../src/node_inotify.h:7:25: error: sys/inotify.h: No such file or directory ../src/bindings.cc: In static member function ‘static void NodeInotify::Inotify::Initialize(v8::Handle<v8::Object>)’: ../src/bindings.cc:34: error: ‘IN_ACCESS’ was not declared in this scope ../src/bindings.cc:35: error: ‘IN_ATTRIB’ was not declared in this scope ../src/bindings.cc:38: error: ‘IN_CLOSE_WRITE’ was not declared in this scope ../src/bindings.cc:39: error: ‘IN_CLOSE_NOWRITE’ was not declared in this scope ../src/bindings.cc:40: error: ‘IN_CREATE’ was not declared in this scope ../src/bindings.cc:41: error: ‘IN_DELETE’ was not declared in this scope ../src/bindings.cc:42: error: ‘IN_DELETE_SELF’ was not declared in this scope ../src/bindings.cc:43: error: ‘IN_MODIFY’ was not declared in this scope ../src/bindings.cc:44: error: ‘IN_MOVE_SELF’ was not declared in this scope ../src/bindings.cc:45: error: ‘IN_MOVED_FROM’ was not declared in this scope ../src/bindings.cc:46: error: ‘IN_MOVED_TO’ was not declared in this scope ../src/bindings.cc:47: error: ‘IN_OPEN’ was not declared in this scope ../src/bindings.cc:48: error: ‘IN_IGNORED’ was not declared in this scope ../src/bindings.cc:51: error: ‘IN_ISDIR’ was not declared in this scope ../src/bindings.cc:52: error: ‘IN_Q_OVERFLOW’ was not declared in this scope ../src/bindings.cc:53: error: ‘IN_UNMOUNT’ was not declared in this scope ../src/bindings.cc:54: error: ‘IN_ALL_EVENTS’ was not declared in this scope ../src/bindings.cc:56: error: ‘IN_ONLYDIR’ was not declared in this scope ../src/bindings.cc:57: error: ‘IN_DONT_FOLLOW’ was not declared in this scope ../src/bindings.cc:58: error: ‘IN_ONESHOT’ was not declared in this scope ../src/bindings.cc:59: error: ‘IN_MASK_ADD’ was not declared in this scope ../src/bindings.cc:62: error: ‘IN_CLOSE’ was not declared in this scope ../src/bindings.cc:63: error: ‘IN_MOVE’ was not declared in this scope ../src/bindings.cc: In static member function ‘static v8::Handle<v8::Value> NodeInotify::Inotify::New(const v8::Arguments&)’: ../src/bindings.cc:113: error: ‘IN_NONBLOCK’ was not declared in this scope ../src/bindings.cc:113: error: ‘IN_CLOEXEC’ was not declared in this scope ../src/bindings.cc:113: error: ‘inotify_init1’ was not declared in this scope ../src/bindings.cc: In static member function ‘static v8::Handle<v8::Value> NodeInotify::Inotify::AddWatch(const v8::Arguments&)’: ../src/bindings.cc:162: error: ‘IN_ALL_EVENTS’ was not declared in this scope ../src/bindings.cc:180: error: ‘inotify_add_watch’ was not declared in this scope ../src/bindings.cc: In static member function ‘static v8::Handle<v8::Value> NodeInotify::Inotify::RemoveWatch(const v8::Arguments&)’: ../src/bindings.cc:203: error: ‘inotify_rm_watch’ was not declared in this scope ../src/bindings.cc: In static member function ‘static void NodeInotify::Inotify::Callback(ev_io*, int)’: ../src/bindings.cc:245: error: invalid application of ‘sizeof’ to incomplete type ‘NodeInotify::inotify_event’ ../src/bindings.cc:247: error: invalid application of ‘sizeof’ to incomplete type ‘NodeInotify::inotify_event’ ../src/bindings.cc:258: error: invalid use of incomplete type ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:245: error: forward declaration of ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:259: error: invalid use of incomplete type ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:245: error: forward declaration of ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:260: error: invalid use of incomplete type ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:245: error: forward declaration of ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:262: error: invalid use of incomplete type ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:245: error: forward declaration of ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:263: error: invalid use of incomplete type ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:245: error: forward declaration of ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:268: error: invalid use of incomplete type ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:245: error: forward declaration of ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:274: error: invalid use of incomplete type ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:245: error: forward declaration of ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:274: error: ‘IN_IGNORED’ was not declared in this scope ../src/bindings.cc:276: error: invalid use of incomplete type ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:245: error: forward declaration of ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:284: error: invalid application of ‘sizeof’ to incomplete type ‘NodeInotify::inotify_event’ ../src/bindings.cc:284: error: invalid use of incomplete type ‘struct NodeInotify::inotify_event’ ../src/bindings.cc:245: error: forward declaration of ‘struct NodeInotify::inotify_event’ Waf: Leaving directory/Users/dale/local/node/lib/node_modules/dev/node_modules/inotify/build'
Build failed:
-> task failed (err #1):
{task: cxx bindings.cc -> bindings_1.o}
-> task failed (err #1):
{task: cxx node_inotify.cc -> node_inotify_1.o}
npm ERR! error installing [email protected] Error: [email protected] install: node-waf configure build
npm ERR! error installing [email protected] sh "-c" "node-waf configure build" failed with 1
npm ERR! error installing [email protected] at ChildProcess.node-waf configure build
npm ERR! error installing [email protected] sh "-c" "node-waf configure build" failed with 1
npm ERR! error installing [email protected] at ChildProcess.node-waf configure build
npm ERR! sh "-c" "node-waf configure build" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the inotify 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 inotify
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Darwin 10.7.0
npm ERR! command "node" "/Users/dale/local/node/bin/npm" "install" "dev" "-g"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/dale/Dropbox/Documents/WebApps/JeffersonSoftware/npm-debug.log
npm not ok
That's inotify. Try to install it separately? Maybe your node is not 0.4.8 ?
Thanks for the quick reply, I've upgraded to node 0.4.8.
npm install inotify -g gives the same error so it's defiantly an inotify issue.
Do they have an issue tracker?
Same problem here on OSX installed node 0.4.8 though ports (did manual install before with same result) installed npm
Installed several other npm packages with no problems.
When installing node-dev same error as dalejefferson described...
hey, inotify is a linux kernel library, meaning that you won't be able to compile node-inotify in OSX.
Yeah, I believe, we need a replacement for Mac using kqueue or maybe FSEvents API (if possible).
what about using fs.watchFile?
That doesn't work right, cause it can't detect new files.
Seems like you can provide directory path to fs.watch: http://nodejs.org/api/fs.html#fs_fs_watch_filename_options_listener
Doesn't it emit events on new files?
It seems to be a Mac OS issue? 'Cause I have the same problem here:
blagus@cosmo:~$ sudo npm install dev -g
npm http GET https://registry.npmjs.org/dev
npm http 304 https://registry.npmjs.org/dev
npm http GET https://registry.npmjs.org/inotify
npm http 304 https://registry.npmjs.org/inotify
> [email protected] install /usr/local/lib/node_modules/dev/node_modules/inotify
> node-gyp rebuild
CXX(target) Release/obj.target/inotify/src/bindings.o
In file included from ../src/bindings.cc:2:
In file included from ../src/bindings.h:4:
../src/node_inotify.h:7:10: fatal error: 'sys/inotify.h' file not found
#include <sys/inotify.h>
^
1 error generated.
make: *** [Release/obj.target/inotify/src/bindings.o] Error 1
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: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 Darwin 12.4.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/dev/node_modules/inotify
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
-- thanks in advance
Got the same issue on os x, but it's working fine with Debian. I've founded https://github.com/ggreer/fsevents-tools which is an inotify wrapper around FSEvent but I still can't get him to work.