npminstall
Advanced tools
Comparing version 0.5.0 to 0.5.1
@@ -34,4 +34,9 @@ #!/usr/bin/env node | ||
const registry = process.env.npm_registry || 'https://registry.npm.taobao.org'; | ||
const production = process.argv.indexOf('--production') > 0; | ||
const production = process.argv.indexOf('--production') > 0 || process.env.NODE_ENV === 'production'; | ||
if (process.argv.indexOf('-v') > 0 || process.argv.indexOf('--version') > 0) { | ||
console.log('v%s', require('../package.json').version); | ||
process.exit(0); | ||
} | ||
co(function*() { | ||
@@ -38,0 +43,0 @@ yield npminstall({ |
0.5.1 / 2016-02-16 | ||
================== | ||
* fix: make sure link latest version parent dir exists | ||
* feat: support process.env.NODE_ENV and add --version command | ||
* fix: only remove done file when install error | ||
0.5.0 / 2016-02-15 | ||
@@ -3,0 +10,0 @@ ================== |
@@ -59,3 +59,3 @@ /** | ||
retry--; | ||
if (err.code === 'ECONNRESET' && retry > 0) { | ||
if ((err.code === 'ECONNRESET' || err.code === 'ENOTFOUND') && retry > 0) { | ||
debug('retry GET %s, retry left %s', url, retry); | ||
@@ -62,0 +62,0 @@ return yield _get(url, options, retry); |
@@ -167,4 +167,4 @@ /** | ||
const parentDir = path.join(storeDir, 'node_modules'); | ||
yield utils.mkdirp(parentDir); | ||
const linkDir = path.join(parentDir, pkg.name); | ||
yield utils.mkdirp(path.dirname(linkDir)); | ||
const realDir = path.join(storeDir, pkg.name, pkg.version); | ||
@@ -171,0 +171,0 @@ const relative = yield utils.forceSymlink(realDir, linkDir); |
@@ -22,2 +22,3 @@ /** | ||
const semver = require('semver'); | ||
const fs = require('mz/fs'); | ||
const get = require('./get'); | ||
@@ -142,9 +143,8 @@ const download = require('./download'); | ||
} catch (err) { | ||
// clean up when install error, make sure next time install won't success. | ||
options.console.error(chalk.red('[%s@%s] install error: %s, parentDir: %s, clean up %s\nerror stack: %s'), | ||
realPkg.name, realPkg.version, err, parentDir, realPkgDir, err.stack); | ||
try { | ||
yield utils.rimraf(realPkgDir); | ||
} catch (_) { | ||
// ignore rimraf error | ||
// delete donefile when install error, make sure next time install won't success. | ||
const donefile = path.join(realPkgDir, '.tnpminstall.done'); | ||
if (yield fs.exists(donefile)) { | ||
options.console.error(chalk.red('[%s@%s] install error: %s, parentDir: %s, remove %s\nerror stack: %s'), | ||
realPkg.name, realPkg.version, err, parentDir, donefile, err.stack); | ||
yield fs.unlink(donefile); | ||
} | ||
@@ -151,0 +151,0 @@ throw err; |
{ | ||
"name": "npminstall", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Let npm install fast and easy", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
34066
832
5