Skip to content

Commit

Permalink
use --no-package-lock in npm after npm 4
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed Aug 16, 2023
1 parent 9d9763a commit 44e32fa
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lib/dependency-manager-adapters/npm.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,14 @@ module.exports = CoreObject.extend({
if (mgrOptions.indexOf('--ignore-engines') === -1) {
mgrOptions = mgrOptions.concat(['--ignore-engines']);
}
} else if (mgrOptions.indexOf('--no-shrinkwrap') === -1) {
mgrOptions = mgrOptions.concat(['--no-shrinkwrap']);
} else if (mgrOptions.indexOf('--no-package-lock') === -1) {
let res = await this.run('npm', ['--version'], { cwd: this.cwd, stdio: 'pipe' });
let version = res.stdout;
if (version.match(/^4./)) {
mgrOptions = mgrOptions.concat(['--no-shrinkwrap']);
} else {
mgrOptions = mgrOptions.concat(['--no-package-lock']);
}
}
}

Expand Down

0 comments on commit 44e32fa

Please sign in to comment.