APM不支持公司代理

时间:2015-02-21 20:15:42

标签: node.js linux ubuntu atom-editor

我运行时遇到的错误(sudo)apm install minimap(或任何其他包):

gyp info it worked if it ends with ok
gyp info using node-gyp@1.0.2
gyp info using node@0.10.35 | linux | x64
gyp http GET https://atom.io/download/atom-shell/v0.21.0/node-v0.21.0.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! install error 
gyp ERR! stack Error: tunneling socket could not be established, cause=Parse Error
gyp ERR! stack     at ClientRequest.onError (/usr/share/atom/resources/app/apm/node_modules/npm/node_modules/request/node_modules/tunnel-agent/index.js:168:17)
gyp ERR! stack     at ClientRequest.g (events.js:180:16)
gyp ERR! stack     at ClientRequest.emit (events.js:95:17)
gyp ERR! stack     at Socket.socketOnData (http.js:1593:9)
gyp ERR! stack     at TCP.onread (net.js:528:27)
gyp ERR! System Linux 3.13.0-45-generic
gyp ERR! command "/usr/share/atom/resources/app/apm/bin/node" "/usr/share/atom/resources/app/apm/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "install" "--target=0.21.0" "--dist-url=https://atom.io/download/atom-shell" "--arch=x64" "--ensure" "--proxy=http://172.31.1.4:8080/"
gyp ERR! cwd /home/anmol/.atom
gyp ERR! node -v v0.10.35
gyp ERR! node-gyp -v v1.0.2
gyp ERR! not ok 

5 个答案:

答案 0 :(得分:2)

在运行命令之前使用: 导出ATOM_NODE_URL = http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist

答案 1 :(得分:2)

您可以通过在终端输入来为Atom设置代理:

$ apm config set proxy "http://user:pass@host:port"
$ apm config set https_proxy "http://user:pass@host:port"

之后你可以打开Atom,你会看到快速的结果;)

答案 2 :(得分:0)

您无法运行apm install [INSERT PACKAGE NAME]。您必须按照文档https://github.com/atom/atom-shell/blob/master/docs/tutorial/using-native-node-modules.md

运行apm install .

另外,我不确定您是否可以从https://atom.io/download/atom-shell代理后面http下载。

答案 3 :(得分:0)

尝试使用apm cli工具设置代理设置

使用apm config set http-proxy https://userid:pwd@host:port

或  apm config set http-proxy https://host:port(如果不需要uid和密码)

要查看设定值,请使用以下命令 使用apm config获取http-proxy

如果你有! (爆炸)你的设置中的符号使用apm配置你运气不好。解析时出现问题!。

答案 4 :(得分:-1)

这对我为公司代理提供了帮助:
Win7 / APM版本2.4.3 / Atom 1.40.1 x64

=>打开或创建文件C:\ Users \ .atom \ .apmrc

=>添加

http-proxy="http://user:pwd@proxy:port"<br>
https-proxy="http://user:pwd@proxy:port"<br>
strict-ssl=false<br>

=>从命令行运行

apm install your-package --verbose

=>重新启动Atom并享受