微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在Ubuntu上安装node-gyp时出错

npm http 200 https://registry.npmjs.org/weak/-/weak-0.2.2.tgz npm http GET https://registry.npmjs.org/bindings npm http 304 https://registry.npmjs.org/bindings > [email protected] install node_modules/weak > node-gyp rebuild Traceback (most recent call last): File "/usr/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py",line 18,in <module> sys.exit(gyp.script_main()) AttributeError: 'module' object has no attribute 'script_main' gyp ERR! configure error gyp ERR! stack Error: `gyp` Failed with exit code: 1 gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:337: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-15-generic gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! node -v v0.10.15 gyp ERR! node-gyp -v v0.12.1 gyp ERR! not ok npm ERR! [email protected] install: `node-gyp rebuild` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] install script. npm ERR! This is most likely a problem with the weak 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 weak npm ERR! There is likely additional logging output above. npm ERR! System Linux 3.11.0-15-generic npm ERR! command "node" "/usr/bin/npm" "install" "[email protected]" npm ERR! node -v v0.10.15 npm ERR! npm -v 1.3.23 npm ERR! code ELIFECYCLE npm ERR! not ok code 0

我没有直接依赖弱或节点gyp,但我想这是我的其他依赖项(expression,幽灵,ejs,aws-sdk,时刻)需要。 任何人都面临这样的问题,并能够解决

在没有node.js的JavaScript服务器端连接到MysqL

Node.js 100%cpu – gettimeofday调用

吞噬任务来处理可写的文件

Rails JavaScript视图在生产中不起作用

Nginx和meteor分开服务静态资产和媒体?

如果您的python版本不是错误的来源,请检查您是否安装了“gyp”。 这与node-gyp中的gyp版本冲突。

apt-get remove gyp

https://github.com/TooTallNate/node-gyp/issues/363#issuecomment-32234646

这是什么工作。 在安装过程中你需要python 2.6。

#!/bin/bash #On Ubuntu Saucy: sudo add-apt-repository ppa:fkrull/deadsnakes sudo apt-get update sudo apt-get install python2.6 sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.6 20 sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10 #you can switch between 2.6 & 2.7 using: sudo update-alternatives --config python #Btw I installed node using ppa:chris-lea/node.js

https://github.com/TooTallNate/node-gyp/issues/363

这个命令sudo apt-get install build-essential帮助了我的情况。

FWIW,我有一个类似的问题试图在Ubuntu 14.04(DigitalOcean)上安装Protractor。 重新安装node-gyp修复它:

apt-get install node-gyp

在Ubuntu 10.04上,安装libicu解决了我的问题。

sudo apt-get install libicu-dev

在Fedora 20上,重新安装gyp为我解决这个问题。

sudo yum reinstall gyp

在试图安装wikimedia扩展mathoid的时候,我在Ubuntu 16.04上遇到了这个问题。

我尝试了一切建议,没有任何工作,直到我做到了:

sudo apt-get install librsvg2-2 librsvg2-dev

我已经有build-essential安装。 我只需要运行:

sudo apt install python

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐