在開源editor領(lǐng)域,你不能不注意到atom的存在:當(dāng)sublime text 3開始收費(fèi),eclipse變得愈來愈臃腫而慢,而且UI及其難看,atom將是1個(gè)很好的選擇。但當(dāng)我第1次使用atom的時(shí)候遇到了下面的這個(gè)問題:
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
從這個(gè)打印上看,應(yīng)當(dāng)是gyp沒法完成http GET(沒法完成atom.io的302重定向)
這里有1個(gè)臨時(shí)的解決方案,就是把ATOM_NODE_URL環(huán)境變量設(shè)為重定向以后的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