Commit b8050efb by Marcin Cieślak

Improve 河蟹 message

parent 14392b90
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
*/ */
var fs = require('fs'), var fs = require('fs'),
eol = require('os').EOL,
mkdir = require('mkdirp'), mkdir = require('mkdirp'),
npmconf = require('npmconf'), npmconf = require('npmconf'),
path = require('path'), path = require('path'),
...@@ -22,11 +23,13 @@ require('../lib/extensions'); ...@@ -22,11 +23,13 @@ require('../lib/extensions');
function download(url, dest, cb) { function download(url, dest, cb) {
var reportError = function(err) { var reportError = function(err) {
cb(['Cannot download "', url, '": ', cb(['Cannot download "', url, '": ', eol, eol,
typeof err.message === 'string' ? err.message : err, typeof err.message === 'string' ? err.message : err, eol, eol,
" Hint: If you are in China, ", 'Hint: If github.com is not accessible in your location', eol,
"try setting a proxy via HTTP_PROXY, e.g. ", ' try setting a proxy via HTTP_PROXY, e.g. ', eol, eol,
"export HTTP_PROXY=http://server.com:1234"].join('')); ' export HTTP_PROXY=http://example.com:1234',eol, eol,
'or configure npm proxy via', eol, eol,
' npm config set proxy http://example.com:8080'].join(''));
}; };
var successful = function(response) { var successful = function(response) {
return response.statusCode >= 200 && response.statusCode < 300; return response.statusCode >= 200 && response.statusCode < 300;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment