我正在关注this tutorial安装 PeP 代理。
我在 CentOS 6.7 上安装了 Node 和 npm:
[root@centos fi-ware-pep-proxy]# node -v
v0.10.41
[root@centos fi-ware-pep-proxy]# npm -v
1.4.29
但是当我进入 fi-ware-pep-proxy 文件夹并运行 npm install
时,出现以下错误:
[root@centos fi-ware-pep-proxy]# npm install
npm WARN deprecated This version of npm lacks support for important features,
npm WARN deprecated such as scoped packages, offered by the primary npm
npm WARN deprecated registry. Consider upgrading to at least npm@2, if not the
npm WARN deprecated latest stable version. To upgrade to npm@2, run:
npm WARN deprecated
npm WARN deprecated npm -g install npm@latest-2
npm WARN deprecated
npm WARN deprecated To upgrade to the latest stable version, run:
npm WARN deprecated
npm WARN deprecated npm -g install npm@latest
npm WARN deprecated
npm WARN deprecated (Depending on how Node.js was installed on your system, you
npm WARN deprecated may need to prefix the preceding commands with `sudo`, or if
npm WARN deprecated on Windows, run them from an Administrator prompt.)
npm WARN deprecated
npm WARN deprecated If you're running the version of npm bundled with
npm WARN deprecated Node.js 0.10 LTS, be aware that the next version of 0.10 LTS
npm WARN deprecated will be bundled with a version of npm@2, which has some small
npm WARN deprecated backwards-incompatible changes made to `npm run-script` and
npm WARN deprecated semver behavior.
-
> <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="a4cacbc0c189c1dcd4c5d0e4968a958a90" rel="noreferrer noopener nofollow">[email protected]</a> install /root/fi-ware-pep-proxy/node_modules/xml2json/node_modules/node-expat
> node-gyp rebuild
make: Entering directory `/root/fi-ware-pep-proxy/node_modules/xml2json/node_modules/node-expat/build'
CC(target) Release/obj.target/expat/deps/libexpat/lib/xmlparse.o
make: cc: Command not found
make: *** [Release/obj.target/expat/deps/libexpat/lib/xmlparse.o] Error 127
make: Leaving directory `/root/fi-ware-pep-proxy/node_modules/xml2json/node_modules/node-expat/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Linux 2.6.32-573.8.1.el6.x86_64
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/fi-ware-pep-proxy/node_modules/xml2json/node_modules/node-expat
gyp ERR! node -v v0.10.41
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm ERR! <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="93fdfcf7f6bef6ebe3f2e7d3a1bda2bda7" rel="noreferrer noopener nofollow">[email protected]</a> install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="aac4c5cecf87cfd2dacbdeea98849b849e" rel="noreferrer noopener nofollow">[email protected]</a> install script.
npm ERR! This is most likely a problem with the node-expat 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 node-expat
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 2.6.32-573.8.1.el6.x86_64
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /root/fi-ware-pep-proxy
npm ERR! node -v v0.10.41
npm ERR! npm -v 1.4.29
npm ERR! code ELIFECYCLE
npm ERR! not ok code 0
我尝试寻找 expat-devel,我也安装了它,但错误仍然存在。
我还检查了我的 python 版本,发现它是:
[root@centos fi-ware-pep-proxy]# python -V
Python 2.6.6
有人知道如何解决这个问题吗?
最佳答案
感谢@Álvaro Alonso,我得出的结论是我应该安装 gcc:
sudo yum install gcc gcc-c++
如下所述:
https://www.vultr.com/docs/how-to-install-gcc-on-centos-6
谢谢!
关于fiware - 我的 PeP 代理安装中缺少什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34292513/