|
|
@ -64,21 +64,23 @@ export default class Now extends EventEmitter { |
|
|
|
} |
|
|
|
|
|
|
|
// Read .npmrc
|
|
|
|
let npmrc; |
|
|
|
try { |
|
|
|
npmrc = await readFile(resolvePath(path, '.npmrc'), 'utf8'); |
|
|
|
npmrc = parseIni(npmrc); |
|
|
|
} catch (err) { |
|
|
|
// Do nothing
|
|
|
|
} |
|
|
|
|
|
|
|
if (!npmrc) { |
|
|
|
let npmrc = {}; |
|
|
|
if (pkg['forward-npm']) { |
|
|
|
try { |
|
|
|
npmrc = await readFile(resolvePath(homedir(), '.npmrc'), 'utf8'); |
|
|
|
npmrc = await readFile(resolvePath(path, '.npmrc'), 'utf8'); |
|
|
|
npmrc = parseIni(npmrc); |
|
|
|
} catch (err) { |
|
|
|
// Do nothing
|
|
|
|
} |
|
|
|
|
|
|
|
if (!npmrc) { |
|
|
|
try { |
|
|
|
npmrc = await readFile(resolvePath(homedir(), '.npmrc'), 'utf8'); |
|
|
|
npmrc = parseIni(npmrc); |
|
|
|
} catch (err) { |
|
|
|
// Do nothing
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const authToken = npmrc['//registry.npmjs.org/:_authToken']; |
|
|
|