How to use the npmlog.warn 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 jxcore / jxcore / deps / npm / node_modules / node-gyp / lib / install.js View on Github external
, headers: {
          'User-Agent': 'node-gyp v' + gyp.version + ' (node ' + process.version + ')'
        }
    }

    // basic support for a proxy server
    var proxyUrl = gyp.opts.proxy
                || process.env.http_proxy
                || process.env.HTTP_PROXY
                || process.env.npm_config_proxy
    if (proxyUrl) {
      if (/^https?:\/\//i.test(proxyUrl)) {
        log.verbose('download', 'using proxy url: "%s"', proxyUrl)
        requestOpts.proxy = proxyUrl
      } else {
        log.warn('download', 'ignoring invalid "proxy" config setting: "%s"', proxyUrl)
      }
    }
    try {
      // The "request" constructor can throw sometimes apparently :(
      // See: https://github.com/TooTallNate/node-gyp/issues/114
      req = request(requestOpts)
    } catch (e) {
      cb(e)
    }
    if (req) {
      req.on('response', function (res) {
        log.http(res.statusCode, url)
      })
    }
    return req
  }
github othiym23 / packard / src / metadata / albums-from-tracks.js View on Github external
}
      dirs.add(dirname(track.file.path))
      // prefer original release date, if set
      dates.add((track.musicbrainzTags && track.musicbrainzTags.originalDate) || track.date)
      if (track.sourceArchive) archives.set(track.sourceArchive.path, track.sourceArchive)
      tracks.add(track)
    }

    const minNames = [...names]
    if (minNames.length === 0) log.error('albumsFromTracks', 'album has no name?', names)
    if (minNames.length > 1) {
      log.error('albumsFromTracks', 'album has more than one name', minNames)
    }

    const minDirs = [...dirs]
    if (minDirs.length === 0) log.warn('albumsFromTracks', 'album has no path?', dirs)
    if (minDirs.length > 1) {
      log.warn('albumsFromTracks', 'album in more than one directory', minDirs)
    }

    const minDates = [...dates.keys()]
    if (minDates.length > 1) {
      log.warn('albumsFromTracks', 'more than one date', minDates)
    }

    const minArchism = [...archives.keys()]
    if (minArchism.length > 1) {
      log.warn('albumsFromTracks', 'more than one source archive', minArchism)
      log.warn('albumsFromTracks', '--archive may not work as expected')
    }

    let artistName
github peterqliu / threebox / 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.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 GoogleContainerTools / kpt / docsy / node_modules / fsevents / node_modules / node-pre-gyp / lib / install.js View on Github external
// 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 apache / incubator-weex-cli / build / display-utils.js View on Github external
_.each(warnJSONObjArray, function (wStr) {
        try {
            var _wStr$split = wStr.split("\n"),
                _wStr$split2 = (0, _slicedToArray3.default)(_wStr$split, 2),
                source = _wStr$split2[0],
                info = _wStr$split2[1];

            source = source.split("!");
            source = source[source.length - 1];
            if (info.indexOf("NOTE:") == -1 && showWarningTitle == false) {
                console.log("Found Warning in your weex file:\n");
                showWarningTitle = true;
            }
            if (info.indexOf("NOTE:") == -1) {
                npmlog.warn(source.trim() + " : " + info.trim());
            }
        } catch (e) {
            npmlog.warn(wStr);
        }
    });
    console.log("\n");
github sx1989827 / DOClever / Client / node_modules / fsevents / node_modules / node-pre-gyp / lib / install.js View on Github external
return callback(e);
        }
    } else if (opts.ca) {
        requestOpts.ca = opts.ca;
    }

    var proxyUrl = opts.proxy ||
                    process.env.http_proxy ||
                    process.env.HTTP_PROXY ||
                    process.env.npm_config_proxy;
    if (proxyUrl) {
      if (/^https?:\/\//i.test(proxyUrl)) {
        log.verbose('download', 'using proxy url: "%s"', proxyUrl);
        requestOpts.proxy = proxyUrl;
      } else {
        log.warn('download', 'ignoring invalid "proxy" config setting: "%s"', proxyUrl);
      }
    }
    try {
        req = require('request')(requestOpts);
    } catch (e) {
        return callback(e);
    }
    if (req) {
      req.on('response', function (res) {
        log.http(res.statusCode, uri);
      });
    }
    return callback(null,req);
}
github racker / node-rproxy / node_modules / cluster2 / node_modules / npm / lib / link.js View on Github external
return fs.realpath(pp, function (er, real) {
          if (er) log.warn("invalid symbolic link", pkg)
          else rp = real
          next()
        })
      }
github orchoban / react.cordova / node_modules / npm / lib / install / action / finalize.js View on Github external
return gentlyRm(pkg.path, false, top).catch((err) => {
      log.warn('rollback', `Rolling back ${packageId(pkg)} failed (this is probably harmless): ${err.message ? err.message : err}`)
    })
  })
github angelozerr / tern.java / eclipse / tern.eclipse.ide.server.nodejs.embed.linux.gtk.x86 / nodejs / node-v0.10.22-linux-x86 / lib / node_modules / npm / lib / cache.js View on Github external
function deprCheck (data) {
  if (deprecated[data._id]) data.deprecated = deprecated[data._id]
  if (data.deprecated) deprecated[data._id] = data.deprecated
  else return
  if (!deprWarned[data._id]) {
    deprWarned[data._id] = true
    log.warn("deprecated", "%s: %s", data._id, data.deprecated)
  }
}
github lerna / lerna / core / command / index.js View on Github external
return ["bootstrap", "publish"].reduce((obj, command) => {
      if (this.name === command && this.repository.lernaJson[`${command}Config`]) {
        log.warn(
          "deprecated",
          `\`${command}Config.ignore\` has been replaced by \`command.${command}.ignore\`.`
        );
        obj.ignore = this.repository.lernaJson[`${command}Config`].ignore;
      }

      return obj;
    }, {});
  }