check-npm-version.js 401 B

1234567891011121314151617
  1. let { execSync } = require('child_process')
  2. let pico = require('picocolors')
  3. try {
  4. let version = parseInt(execSync('npm -v'))
  5. if (version <= 6) {
  6. process.stderr.write(
  7. pico.red(
  8. 'Update npm or call ' +
  9. pico.yellow('npx browserslist@latest --update-db') +
  10. '\n'
  11. )
  12. )
  13. process.exit(1)
  14. }
  15. // eslint-disable-next-line no-unused-vars
  16. } catch (e) {}