How to use the npmlog.http function in npmlog

To help you get started, we’ve selected a few npmlog examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github weixin / Miaow / node_modules / fsevents / node_modules / node-pre-gyp / lib / install.js View on Github external
function print_fallback_error(err,opts,package_json) {
    var fallback_message = ' (falling back to source compile with node-gyp)';
    var full_message = '';
    if (err.statusCode !== undefined) {
        // If we got a network response it but failed to download
        // it means remote binaries are not available, so let's try to help
        // the user/developer with the info to debug why
        full_message = "Pre-built binaries not found for " + package_json.name + "@" + package_json.version;
        full_message += " and " + opts.runtime + "@" + (opts.target || process.versions.node) + " (" + opts.node_abi + " ABI, " + opts.libc + ")";
        full_message += fallback_message;
        log.error("Tried to download(" + err.statusCode + "): " + opts.hosted_tarball);
        log.error(full_message);
        log.http(err.message);
    } else {
        // If we do not have a statusCode that means an unexpected error
        // happened and prevented an http response, so we output the exact error
        full_message = "Pre-built binaries not installable for " + package_json.name + "@" + package_json.version;
        full_message += " and " + opts.runtime + "@" + (opts.target || process.versions.node) + " (" + opts.node_abi + " ABI, " + opts.libc + ")";
        full_message += fallback_message;
        log.error(full_message);
        log.error("Hit error " + err.message);
    }
}
github graalvm / graaljs / deps / npm / node_modules / node-gyp / lib / install.js View on Github external
function download (gyp, env, url) {
  log.http('GET', url)

  var requestOpts = {
    uri: url,
    headers: {
      'User-Agent': 'node-gyp v' + gyp.version + ' (node ' + process.version + ')'
    }
  }

  var cafile = gyp.opts.cafile
  if (cafile) {
    requestOpts.ca = readCAFile(cafile)
  }

  // basic support for a proxy server
  var proxyUrl = gyp.opts.proxy ||
              env.http_proxy ||
github sx1989827 / DOClever / node_modules / fsevents / node_modules / node-pre-gyp / lib / install.js View on Github external
function download(uri,opts,callback) {
    log.http('GET', uri);

    var req = null;

    // Try getting version info from the currently running npm.
    var envVersionInfo = process.env.npm_config_user_agent ||
        'node ' + process.version;

    var requestOpts = {
        uri: uri.replace('+','%2B'),
        headers: {
          'User-Agent': 'node-pre-gyp (v' + npgVersion + ', ' + envVersionInfo + ')'
        },
        follow_max: 10,
    };

    if (opts.cafile) {
github mapbox / node-pre-gyp / lib / install.js View on Github external
function print_fallback_error(err,opts,package_json) {
    var fallback_message = ' (falling back to source compile with node-gyp)';
    var full_message = '';
    if (err.statusCode !== undefined) {
        // If we got a network response it but failed to download
        // it means remote binaries are not available, so let's try to help
        // the user/developer with the info to debug why
        full_message = "Pre-built binaries not found for " + package_json.name + "@" + package_json.version;
        full_message += " and " + opts.runtime + "@" + (opts.target || process.versions.node) + " (" + opts.node_abi + " ABI, " + opts.libc + ")";
        full_message += fallback_message;
        log.warn("Tried to download(" + err.statusCode + "): " + opts.hosted_tarball);
        log.warn(full_message);
        log.http(err.message);
    } else {
        // If we do not have a statusCode that means an unexpected error
        // happened and prevented an http response, so we output the exact error
        full_message = "Pre-built binaries not installable for " + package_json.name + "@" + package_json.version;
        full_message += " and " + opts.runtime + "@" + (opts.target || process.versions.node) + " (" + opts.node_abi + " ABI, " + opts.libc + ")";
        full_message += fallback_message;
        log.warn(full_message);
        log.warn("Hit error " + err.message);
    }
}
github nodemailer / mailcast / app.js View on Github external
write: message => {
                message = (message || '').toString();
                if (message) {
                    log.http(process.pid + '/Express', message.replace('\n', '').trim());
                }
            }
        }
github zekesonxx / wow-cli / lib / wowinterface.js View on Github external
wowinterface.getDownloadURL = function(addon, version, cb) {
  if (version !== null) {
    log.warn('wowinterface', 'specific versions of wowinterface addons can\'t be installed (yet, is possible, will come soon).');
  }
  var addonid = wowinterface.extractID(addon);
  var url = wowinterface.craftInfoURL(wowinterface.extractID(addon));
  log.http('GET', url);
  request.get({
    url: url
  }, function(err, res, body) {
    log.http(res.statusCode, url);
    if (err) return cb(err);
    var versionresult = wowinterface.versionRegex.exec(body);
    var nameresult = wowinterface.nameRegex.exec(body);
    var name, version;
    if (versionresult[1]) {
      version = versionresult[1];
    } else {
      return cb(new Error('Unable to find version string in webpage. Did wowinterface change something?'));
    }

    if (nameresult && parseInt(nameresult[1]) === addonid && nameresult[2]) {
      name = nameresult[2];
github enyojs / ares-project / hermes / bdPhoneGap.js View on Github external
(function _returnFormData(buffer, next) {
			fs.unlink(tempFileName);
			log.http("BdPhoneGap#downloadApp#_returnFormData()", "streaming down:", fileName);
			this.returnFormData([{
				name: fileName,
				buffer: buffer
			}], res, next);
		}).bind(this)
	], function(err) {
github aikar / timings / node_modules / node-sass / node_modules / pangyp / lib / install.js View on Github external
req.on('response', function (res) {
        log.http(res.statusCode, url)
      })
    }