首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用NPM安装Inotify

用NPM安装Inotify
EN

Stack Overflow用户
提问于 2012-03-04 06:04:03
回答 1查看 2K关注 0票数 1

我对nodeJS非常陌生,我正在尝试使用(NPM)安装一个名为inotify的包。

安装NPM (在OSX上)之后,我尝试使用以下命令安装inotify:

sudo npm安装

我得到了以下错误:

代码语言:javascript
复制
npm http GET https://registry.npmjs.org/inotify
npm http 304 https://registry.npmjs.org/inotify

> inotify@0.2.2 install /usr/local/lib/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 /usr/local/Cellar/node/0.6.6 
Checking for program node                : /usr/local/bin/node 
Checking for function inotify_init       : not found 
/usr/local/lib/node_modules/inotify/src/wscript:11: error: the configuration failed (see '/usr/local/lib/node_modules/inotify/build/config.log')
npm ERR! error installing inotify@0.2.2

npm ERR! inotify@0.2.2 install: `node-waf configure build`
npm ERR! `sh "-c" "node-waf configure build"` failed with 1
npm ERR! 
npm ERR! Failed at the inotify@0.2.2 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 11.2.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "inotify"
npm ERR! cwd /Users/username/code
npm ERR! node -v v0.6.6
npm ERR! npm -v 1.1.4
npm ERR! code ELIFECYCLE
npm ERR! message inotify@0.2.2 install: `node-waf configure build`
npm ERR! message `sh "-c" "node-waf configure build"` failed with 1
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/username/code/npm-debug.log
npm not ok

有人能帮我解决这个问题吗

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-03-04 09:49:31

inotify模块不会构建,因为它找不到inotify_init。这是因为inotify在OS上不可用。

OS上的FSEvents API提供了类似的功能,但它是一个完全不同的API。inotify模块在这种情况下无法工作。

根据您要做的事情,fs.watch可能适合您的需要。它抽象出平台之间的差异:

在Linux系统上,它使用inotify.

  • On BSD系统(包括OS ),它使用kqueue.

  • On SunOS系统(包括Solaris和SmartOS),它使用事件端口。
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9552744

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档