【发布时间】:2013-11-14 07:59:30
【问题描述】:
我试图在我的 ubuntu 虚拟机上 npm install pg 并且出现错误:
> pg@1.1.0 install /usr/local/lib/node_modules/core/node_modules/pg
> node-gyp rebuild || (exit 0)
gyp: binding.gyp not found (cwd: /usr/local/lib/node_modules/core/node_modules/pg) 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/share/node-gyp/lib/configure.js:431:16)
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.11.0-12-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/core/node_modules/pg
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/npm-debug.log
npm ERR! not ok code 0
nodejs -v
v0.10.15
npm -v
1.2.18
知道怎么解决吗?
【问题讨论】:
-
您的 binding.gyp 不知何故丢失了。您是否尝试重新安装它?
-
你能告诉我们你的
$PATH吗?另外,请参阅此relevant question。 -
echo $PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local /游戏
-
sudo apt-get install libpq-dev 帮助 :) 谢谢!
标签: node.js installation npm gyp