atom在linux下安装插件失败的解决方案

gyp info it worked if it ends with ok
gyp info using node-gyp@2.0.2
gyp info using node@0.10.40 | linux | x64
gyp http GET https://atom.io/download/atom-shell/v0.34.0/node-v0.34.0.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! install error 
gyp ERR! stack Error: This is most likely not a problem with node-gyp or the package itself and
gyp ERR! stack is related to network connectivity. In most cases you are behind a proxy or have bad 
gyp ERR! stack network settings.
gyp ERR! stack at Request.<anonymous> (/opt/atom/resources/app/apm/node_modules/npm/node_modules/node-gyp/lib/install.js:234:21)
gyp ERR! stack at Request.emit (events.js:95:17)
gyp ERR! stack at Request.onRequestError (/opt/atom/resources/app/apm/node_modules/npm/node_modules/request/request.js:861:8)
gyp ERR! stack at ClientRequest.emit (events.js:95:17)
gyp ERR! stack at Socket.socketErrorListener (http.js:1548:9)
gyp ERR! stack at Socket.emit (events.js:95:17)
gyp ERR! stack at net.js:834:16
gyp ERR! stack at process._tickCallback (node.js:448:13)
gyp ERR! System Linux 3.16.0-38-generic
gyp ERR! command "/opt/atom/resources/app/apm/bin/node" "/opt/atom/resources/app/apm/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "install" "--target=0.34.0" "--dist-url=https://atom.io/download/atom-shell" "--arch=x64" "--ensure"
gyp ERR! cwd /home/rkz2013/.atom
gyp ERR! node -v v0.10.40
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok

解决办法是不用apm install  而是用npm install...之前要安装一个npm

sudo apt-get install npm

即可。

rkz2013@111qqz-ThinkPad-X200 ~/.atom/packages/activate-power-mode $ npm install
npm http GET https://registry.npmjs.org/lodash.throttle
npm http 200 https://registry.npmjs.org/lodash.throttle
npm http GET https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-3.0.4.tgz
npm http 200 https://registry.npmjs.org/lodash.throttle/-/lodash.throttle-3.0.4.tgz
npm http GET https://registry.npmjs.org/lodash.debounce
npm http 200 https://registry.npmjs.org/lodash.debounce
npm http GET https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-3.1.1.tgz
npm http 200 https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-3.1.1.tgz
npm http GET https://registry.npmjs.org/lodash._getnative
npm http 200 https://registry.npmjs.org/lodash._getnative
npm http GET https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz
npm http 200 https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz
lodash.throttle@3.0.4 node_modules/lodash.throttle
└── lodash.debounce@3.1.1 (lodash._getnative@3.9.1)
rkz2013@111qqz-ThinkPad-X200 ~/.atom/packages/activate-power-mode

$