国内最全IT社区平台 联系我们 | 收藏本站
华晨云阿里云优惠2
您当前位置:首页 > php开源 > 综合技术 > 如何解决atom无法安装package的问题(gyp WARN install got an error, rolling back install)

如何解决atom无法安装package的问题(gyp WARN install got an error, rolling back install)

来源:程序员人生   发布时间:2016-06-24 13:54:47 阅读次数:9878次

在开源editor领域,你不能不注意到atom的存在:当sublime text 3开始收费,eclipse变得愈来愈臃肿而慢,而且UI及其难看,atom将是1个很好的选择。但当我第1次使用atom的时候遇到了下面的这个问题:

C:\Users\pt100314\.atom>apm install editor-stats --unsafe Installing editor-stats to C:\Users\pt100314\.atom\packages gyp info it worked if it ends with ok gyp info using node-gyp@2.0.2 gyp info using node@0.10.40 | win32 | ia32 gyp http GET https://atom.io/download/atom-shell/v0.34.5/node-v0.34.5.tar.gz gyp WARN install got an error, rolling back install gyp

从这个打印上看,应当是gyp没法完成http GET(没法完成atom.io的302重定向)
这里有1个临时的解决方案,就是把ATOM_NODE_URL环境变量设为重定向以后的Url :

Windows temporary:

set ATOM_NODE_URL=http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist

Windows permanently (execute “cmd” with “Run as Administrator”):

setx ATOM_NODE_URL http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist /M

Linux:

export ATOM_NODE_URL=http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist
生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠
程序员人生
------分隔线----------------------------
分享到:
------分隔线----------------------------
关闭
程序员人生