Description
While updating plugins on Atom, it often fails. If you try using apm to update manually, the gyp reports a 404 error.
1 2 3 4 5 6 7 8 |
E:\Atom\resources\app\apm\bin>apm install --check Checking for native build tools failed gyp info it worked if it ends with ok gyp info using [email protected] gyp info using [email protected] | win32 | ia32 gyp http GET https://atom.io/download/atom-shell/v0.36.8/node-v0.36.8.tar.gz gyp http 404 https://atom.io/download/atom-shell/v0.36.8/node-v0.36.8.tar.gz |
However if you try to download the file https://atom.io/download/atom-shell/v0.36.8/node-v0.36.8.tar.gz, it turns out to be there, not 404.
1 2 3 4 5 6 7 8 9 10 11 12 |
[root@localhost ~]# wget https://atom.io/download/atom-shell/v0.36.8/node-v0.36.8.tar.gz --2016-04-20 09:54:26-- https://atom.io/download/atom-shell/v0.36.8/node-v0.36.8.tar.gz Resolving atom.io (atom.io)... 107.20.149.254, 107.22.245.220, 23.21.115.246 Connecting to atom.io (atom.io)|107.20.149.254|:443... connected. HTTP request sent, awaiting response... 302 Found Location: http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist/v0.36.8/node-v0.36.8.tar.gz [following] --2016-04-20 09:54:29-- http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist/v0.36.8/node-v0.36.8.tar.gz Resolving gh-contractor-zcbenz.s3.amazonaws.com (gh-contractor-zcbenz.s3.amazonaws.com)... 54.231.50.50 Connecting to gh-contractor-zcbenz.s3.amazonaws.com (gh-contractor-zcbenz.s3.amazonaws.com)|54.231.50.50|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 448333 (438K) [application/x-tar] Saving to: ‘node-v0.36.8.tar.gz’ |
What happened?
Followed this Issue, and I found node-gyp isn’t following the 302 Redirect sent by atom.io.
I have had this problem before, which the program writing in JS don’t follow the 302 redirect.
The gyp seems it can’t recognize HTTP Status Code, and mistake every code it can’t recognize for 404.
When it will happen?
This problem came out after the version 1.7 of Atom released. I think this should be a bug of new version, beacause at 1.6.1, there is no such a problem.
How to fix it temporarily?
As this Issue said, setting the ATOM_NODE_URL env variable will help you to fixed.
Windows(Tested by myself):
1 |
set ATOM_NODE_URL=http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist |
Linux(I didn’t test yet):
1 |
export ATOM_NODE_URL=http://gh-contractor-zcbenz.s3.amazonaws.com/atom-shell/dist |
As the Issue said, remove the entry when the bug gets fixed! You can get more information in that issue.
1 2 3 4 5 6 7 8 9 10 |
E:\Atom\resources\app\apm\bin>set ATOM_NODE_URL=http://gh-contractor-zcbenz.s3.a mazonaws.com/atom-shell/dist E:\Atom\resources\app\apm\bin>apm install --check Checking for native build tools done E:\Atom\resources\app\apm\bin>apm update Package Updates Available (1) └── atom-beautify 0.29.4 -> 0.29.6 Would you like to install these updates? (yes) yes Installing atom-beautify@0.29.6 to C:\Users\sunfu\.atom\packages done E:\Atom\resources\app\apm\bin> |
Will it work?
Actually, I’m not sure. Before hours, Atom.io released the new version v1.7.2, and this bug is still there.
What’s more? After I search from Google, It seems that if you are forced to using a proxy, the gyp may ignore the setting. There are a long way to go.
近期评论