Atom安裝外掛失敗的解決方法

前言

心血來潮,突然想換一個程式碼編輯器,在百度上搜來搜去看中了Atom。不過這傢伙預設是英文介面,想切換成中文還要再安裝一個漢化外掛,而問題也由此而來。。。

問題表現

安裝外掛時提示如下錯誤:

Installing “simplified-chinese-menu@5.3.5” failed.Hide output…
gyp info it worked if it ends with ok
gyp info using node-gyp@3.4.0
gyp info using node@6.9.5 | win32 | x64
gyp http GET https://atom.io/download/electron/v1.6.15/iojs-v1.6.15.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! install error
gyp ERR! stack Error: connect ECONNREFUSED 52.216.80.64:443
gyp ERR! stack     at Object.exports._errnoException (util.js:1022:11)
gyp ERR! stack     at exports._exceptionWithHostPort (util.js:1045:20)
gyp ERR! stack     at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1087:14)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Users\\huaidan\\AppData\\Local\\atom\\app-1.23.3\\resources\\app\\apm\\bin\\node.exe" "C:\\Users\\huaidan\\AppData\\Local\\atom\\app-1.23.3\\resources\\app\\apm\\node_modules\\node-gyp\\bin\\node-gyp.js" "install" "--runtime=electron" "--target=1.6.15" "--dist-url=https://atom.io/download/electron" "--arch=x64" "--ensure"
gyp ERR! cwd C:\Users\huaidan\.atom
gyp ERR! node -v v6.9.5
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
Compiler tools not found
Packages that depend on modules that contain C/C++ code will fail to install.
Read here for instructions on installing Python and Visual Studio.
Run apm install --check after installing to test compiling a native module.

問題原因

這個問題其實是偉大的社會主義和諧牆導致的,當然,我不是批評和諧牆,也不是說和諧牆不好,只是和諧牆有時候可能會誤傷一些正規站點,讓人很無奈,而且還不許搭梯子。。。

解決方法:

開啟CMD命令提示符(Linux下則開啟shell,執行的命令都是相同的)。

C:\>apm config set registry https://registry.npm.taobao.org //切換npm源為國內源
C:\>apm install //安裝環境軟體
Installing modules done //提示安裝成功

此時再次返回Atom中安裝外掛即可成功。

Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha Code