在npm安装期间,在mac 10.5.8上findnode-gyp'pkg-config:command not found'

试图在github项目的mac-osx上进行npm安装。 不要在packages.json中看到pkg-config为什么node-gyp期望这样? 好像node-gyp应该包含pkg-config。 我认为这是节点工作的方式。 安装一个软件包,它可以根据需要进行安装。 我想这是不同的。 也想知道哪个版本的pkg-config其寻找。

是的,我一直在那里下载压缩包,但它的mac安装说明真的是无稽之谈。 它保持./configure然后进行安装。 但是,makefile不可用,一切都在同一目录级别,但它说cd到代码目录等

 > node-gyp重build

 / bin / sh:找不到pkg-config:命令
 gyp:调用'pkg-config libzmq --libs'返回退出状态127.试图加载binding.gyp
 gyp ERR! configuration错误 
 gyp ERR! 堆栈错误:`gyp`失败,退出代码:1
 gyp ERR! 在ChildProcess.onCpExit(/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:343:16)
 gyp ERR! 在ChildProcess.emit(events.js:98:17)
 gyp ERR! 在Process.ChildProcess._handle.onexit(child_process.js:820:12)
 gyp ERR! 系统达尔文12.5.0
 gyp ERR! 命令“node”“/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js”“rebuild”
 gyp ERR!  cwd / Users / Mac1 / Downloads / projdirectory / node_modules / zmq
 gyp ERR!  node -v v0.10.35
 gyp ERR!  node-gyp -v v1.0.1
 gyp ERR! 不好 
 npm WARN可选dep失败,继续zmq@2.8.0

这与pkg-config npm模块无关。 这是zmq模块的构build失败。 /bin/sh:位告诉你它试图在你的shell上运行一个实际的命令,在这种情况下,它可能是一个pkg-config脚本,可能在/usr/local/include/zmq/opt/local/include/zmq文件夹。

没有findpkg-config的原因,是因为ZMQ不是本地节点模块,所以在运行你正在运行的npm install之前,你必须确保你已经下载并安装了ZMQ。

在这种情况下,您正尝试安装zmq或其中一个库,这都需要将ZMQ产品安装到您的系统上。

每当你在npm install失败的时候看到node-gyp npm install ,你想要安装的是你的操作系统原生的另一个工具的节点包装器。

编辑:看了最新的安装zmq后,没有pkg-config文件夹,而是…有一个pkgconfig文件夹。

有一个报告这个错误,但单靠这一点不能解决OP问题。 如果你使用自制软件,你可以先运行

 brew install zeromq brew install pkgconfig 

然后运行你的npm install (whatever zmq lib you were installing)npm install (whatever zmq lib you were installing)

否则,你将不得不做一些工作来从源代码重build你的zmq,并将安装前缀添加到你的$PATH

/ bin / sh:找不到pkg-config:命令,需要安装pkg-config

运行以下命令安装它: $ brew install pkg-config 。 之后,再次运行npm install。 $ npm install zmq