function printAlternateMsg () { const json = npm.config.get('json') const alternateMsg = json ? JSON.stringify({ title: errMsg, url }, null, 2) : `${errMsg}:\n\n${url}` output(alternateMsg) }
function shouldScrubName (name) { const scope = getScope(name) const cfg = npm.config // avoid the no-dynamic-lookups test return Boolean(scope && cfg.get(scope + ':registry')) }
npm.load({ cache: common.cache }, () => { npm.config.set('cache', common.cache) const er = new Error('access is e, i am afraid') er.code = 'EACCES' er.errno = -13 er.path = common.cache + '/src' er.dest = common.cache + '/to' t.match(errorMessage(er), { summary: [ [ '', new RegExp('\n' + 'Your cache folder contains root-owned files, due to a bug in\n' + 'previous versions of npm which has since been addressed.\n' + '\n' + 'To permanently fix this problem, please run:\n' + ' sudo chown -R [0-9]+:[0-9]+ ".*npm_cache_cache-eacces-error-message"' ) ] ], detail: [] }, 'get the helpful error message') })
function ci (args, cb) { const opts = { cache: path.join(npm.config.get('cache'), '_cacache'), if (npm.config.get('dev')) { log.warn('ci', 'Usage of the `--dev` option is deprecated. Use `--also=dev` instead.') for (const key in npm.config.list[0]) { if (!['log', 'cache'].includes(key)) { opts[key] = npm.config.list[0][key]
const writeOrAppend = (method, file, data) => { if (!cache) { cache = npm.config.get('cache')
function mkConfig (...providers) { if (!baseConfig) { baseConfig = NpmConfig(npm.config, { cache: path.join(npm.config.get('cache'), '_cacache'), if (npm.config.get('prefer-online') === undefined) { conf = conf.concat({ 'prefer-online': npm.config.get('cache-max') <= 0 }) if (npm.config.get('prefer-online') === undefined) { conf = conf.concat({ 'prefer-online': npm.config.get('cache-min') >= 9999 })