Node.js 安装zmq节点模块时出错

Node.js 安装zmq节点模块时出错,node.js,zeromq,Node.js,Zeromq,在安装zmq节点模块时,出现以下错误。 我已经安装了node的最新稳定版本 我在OS X 10.9.3上运行Mac npm http GET https://registry.npmjs.org/zmq npm http 304 https://registry.npmjs.org/zmq npm http GET https://registry.npmjs.org/nan npm http GET https://registry.npmjs.org/bindings npm http 30

在安装zmq节点模块时,出现以下错误。 我已经安装了node的最新稳定版本

我在OS X 10.9.3上运行Mac

npm http GET https://registry.npmjs.org/zmq
npm http 304 https://registry.npmjs.org/zmq
npm http GET https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/bindings

> zmq@2.7.0 install /Users/mario/node_modules/zmq
> node-gyp rebuild

/bin/sh: pkg-config: command not found
gyp: Call to 'pkg-config libzmq --libs' returned exit status 127. 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:340:16)
gyp ERR! stack     at ChildProcess.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:809:12)
gyp ERR! System Darwin 13.2.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/mario/node_modules/zmq
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v0.13.0
gyp ERR! not ok 
npm ERR! zmq@2.7.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the zmq@2.7.0 install script.
npm ERR! This is most likely a problem with the zmq 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 zmq
npm ERR! There is likely additional logging output above.

npm ERR! System Darwin 13.2.0
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "zmq"
npm ERR! cwd /Users/mario/messaging
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/mario/messaging/npm-debug.log
npm ERR! not ok code 0

为什么会出现此错误?我应该如何修复它?

看起来您需要安装
pkg config

/bin/sh:pkg config:未找到命令


请尝试
brew安装软件包配置

您已经安装了吗?它必须先安装在node.js模块之前,node.js模块只是已安装软件包的绑定。是的,我使用自制软件安装了zmq<代码>brew安装zmq在此期间,我卸载了npm以重新安装它,现在再次安装它时遇到问题!当我键入
npm install-g
时,它返回
npm:command not found
如果您卸载了
npm
,那么您不能使用它再次安装自己。那么我如何再次安装npm?我刚从一台pc换成了一台mac!