bd265df2c6256e2381c04f4b4d7297e5b9b2b308a263ec6a0090b8de6a2b114b5a00bfcb146e17ea51674a3a3079b34003edc0b0618e0a06c5b1b00efbc454-exec 1.1 KB

12345678910111213141516171819202122232425262728
  1. #!/usr/bin/env node
  2. const [major, minor] = process.version.slice(1).split('.')
  3. const COMPATIBILITY_PAGE = `Visit https://r.pnpm.io/comp to see the list of past pnpm versions with respective Node.js version support.`
  4. // We don't use the semver library here because:
  5. // 1. it is already bundled to dist/pnpm.cjs, so we would load it twice
  6. // 2. we want this file to support potentially older Node.js versions than what semver supports
  7. if (major < 18 || major == 18 && minor < 12) {
  8. console.error(`ERROR: This version of pnpm requires at least Node.js v18.12
  9. The current version of Node.js is ${process.version}
  10. ${COMPATIBILITY_PAGE}`)
  11. process.exit(1)
  12. }
  13. // We need to load v8-compile-cache.js separately in order to have effect
  14. try {
  15. // Use node.js 22 new API for better performance.
  16. if(!require('module')?.enableCompileCache?.())
  17. require('v8-compile-cache');
  18. } catch {
  19. // We don't have/need to care about v8-compile-cache failed
  20. }
  21. global['pnpm__startedAt'] = Date.now()
  22. require('../dist/pnpm.cjs')
  23. // if you want to debug at your local env, you can use this
  24. // require('../lib/pnpm')