mirror of
https://github.com/transloadit/uppy.git
synced 2026-01-23 02:25:07 +00:00
build: add npm version check
This commit is contained in:
parent
4cfff53b6c
commit
33e656cad3
2 changed files with 19 additions and 0 deletions
18
bin/check-npm-version.js
Normal file
18
bin/check-npm-version.js
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env node
|
||||
'use strict'
|
||||
|
||||
const userAgent = process.env.npm_config_user_agent
|
||||
if (!userAgent) {
|
||||
// not much we can do
|
||||
process.exit()
|
||||
}
|
||||
|
||||
if (/^npm\/7/.test(userAgent)) {
|
||||
console.error('Please use npm 6 to work in the Uppy monorepo.')
|
||||
console.error('You can execute individual commands with npm 6 like below:')
|
||||
console.error()
|
||||
console.error(' $ npx npm@6 install')
|
||||
console.error()
|
||||
console.error('This way you can still use npm 7 in your other projects.')
|
||||
process.exit(1)
|
||||
}
|
||||
|
|
@ -240,6 +240,7 @@
|
|||
"lint:markdown": "remark -f -q . -i .gitignore",
|
||||
"lint:staged": "lint-staged",
|
||||
"lint": "eslint . --cache",
|
||||
"preinstall": "node ./bin/check-npm-version.js",
|
||||
"release": "bash ./bin/release",
|
||||
"size": "echo 'JS Bundle mingz:' && cat ./packages/uppy/dist/uppy.min.js | gzip | wc -c && echo 'CSS Bundle mingz:' && cat ./packages/uppy/dist/uppy.min.css | gzip | wc -c",
|
||||
"start:companion": "bash ./bin/companion",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue