check-npm-version.js 498 B

123456789101112131415161718
  1. #!/usr/bin/env node
  2. 'use strict'
  3. const userAgent = process.env.npm_config_user_agent
  4. if (!userAgent) {
  5. // not much we can do
  6. process.exit()
  7. }
  8. if (/^npm\/7/.test(userAgent)) {
  9. console.error('Please use npm 6 to work in the Uppy monorepo.')
  10. console.error('You can execute individual commands with npm 6 like below:')
  11. console.error()
  12. console.error(' $ npx npm@6 install')
  13. console.error()
  14. console.error('This way you can still use npm 7 in your other projects.')
  15. process.exit(1)
  16. }