当我安装geoip(https://github.com/kuno/GeoIP)
时sudo npm install geoip (-g)
我有这个错误
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/root/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 Linux 3.2.0-24-virtual
gyp ERR! command "node" "/root/local/lib/node_modules/npm/node_modules/node-gyp/bin/node- gyp.js" "rebuild"
gyp ERR! cwd /var/www/test.com/node_modules/geoip
gyp ERR! node -v v0.10.18
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0
任何人都有同样的问题吗? 这在Ubuntu 12.04上远程发生。在OSX本地,它可以工作。
答案 0 :(得分:2)
安装失败,因为它找不到zlip.h
文件。请在执行npm install geoip
命令
sudo apt-get install zlib1g-dev