Add CI step to ensure lockfile v2
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
03ad0246d1
commit
a6d1d77cbc
|
@ -4,8 +4,15 @@ type: docker
|
|||
name: node16
|
||||
|
||||
steps:
|
||||
- name: check-lockfile
|
||||
image: node:16
|
||||
commands:
|
||||
- node ./check-lockfile.js
|
||||
|
||||
- name: install-deps
|
||||
image: node:16
|
||||
depends_on:
|
||||
- check-lockfile
|
||||
commands:
|
||||
- npm install
|
||||
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
const lockfile = require('./package-lock.json')
|
||||
|
||||
if (lockfile.lockfileVersion !== 2) {
|
||||
console.error(`
|
||||
Please upgrade to npm v7 and revert changes to the lockfile.
|
||||
|
||||
- \`npm i -g npm\` to upgrade.
|
||||
`.trim())
|
||||
process.exit(1)
|
||||
}
|
Loading…
Reference in New Issue