release: Enforce lockfileVersion 1

pull/4792/head
Richard Hansen 2021-02-15 13:56:41 -05:00 committed by John McLear
parent 1ada0ab5d6
commit 2691d556fe
1 changed files with 6 additions and 0 deletions

View File

@ -62,6 +62,12 @@ writeJson('./src/package.json', pkg);
childProcess.execSync('npm install --package-lock-only', {cwd: 'src/'});
// run npm install --package-lock-only <-- required???
// Many users will be using the latest LTS version of npm, and the latest LTS version of npm uses
// lockfileVersion 1. Enforce v1 so that users don't see a (benign) compatibility warning.
if (readJson('./src/package-lock.json').lockfileVersion !== 1) {
throw new Error('Please regenerate package-lock.json with npm v6.x.');
}
childProcess.execSync('git add src/package.json');
childProcess.execSync('git add src/package-lock.json');
childProcess.execSync('git commit -m "bump version"');