Atom编辑器安装 Emmet插件的时候遇到报错:
gyp info it worked if it ends with ok gyp info using node-gyp@3.4.0 gyp info using node@6.9.5 | linux | 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 ETIMEDOUT 52.216.0.8: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 Linux 4.4.0-112-generic gyp ERR! command "/opt/atom/resources/app/apm/bin/node" "/opt/atom/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 /home/lushg/.atom gyp ERR! node -v v6.9.5 gyp ERR! node-gyp -v v3.4.0 gyp ERR! not ok
自动安装失败,就学习了一下手动安装。
atom的插件都是安装在~/.atom/packages里,进入该目录,git clone 源码然后 cnpm install即可,重启生效。
cd ~/.atom/packages
git clone https://github.com/emmetio/emmet-atom
cd emmet-atom
cnpm install