Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing engines in package.json #75

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

LunaticMuch
Copy link
Contributor

This PR introduces engines in package.json

I see a value in having engines, particularly for avoiding possible issues with node <16 (still commonly found in many systems) that have different SSL options.

With a node <16 you can easily get into this issue because of old SSL providers, which in turns requires to enable " export NODE_OPTIONS=--openssl-legacy-provider" (cf --openssl-legacy-provider)

Command failed: npm run build
    warn  - No ESLint configuration detected. Run next lint to begin setup
    Browserslist: caniuse-lite is outdated. Please run:
    npx browserslist@latest --update-db

    Why you should do it regularly:
    https://github.com/browserslist/browserslist#browsers-data-updating
    node:internal/crypto/hash:71
      this[kHandle] = new _Hash(algorithm, xofLen);
                      ^

    Error: error:0308010C:digital envelope routines::unsupported

      30 |         process.chdir(cwd)
      31 |         execSync('npm install')
    > 32 |         execSync('npm run build')
         |         ^
      33 |       })
      34 |
      35 |       afterEach(() => {

      at BulkUpdateDecorator.hashFactory (__tests__/__fixtures__/custom-output-directory/node_modules/next/dist/compiled/webpack/bundle5.js:133863:18)
      at BulkUpdateDecorator.update (__tests__/__fixtures__/custom-output-directory/node_modules/next/dist/compiled/webpack/bundle5.js:133764:50)
      at __tests__/__fixtures__/custom-output-directory/node_modules/next/dist/compiled/webpack/bundle5.js:56911:9
      at process.processImmediate (__tests__/__fixtures__/custom-output-directory/node:internal/timers:447:9) {
        opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
        library: 'digital envelope routines',
        reason: 'unsupported',
        code: 'ERR_OSSL_EVP_UNSUPPORTED'
      }
      at Object.execSync (__tests__/index.js:32:9)

},
"engines": {
"node": "^18 || ^19 || ^20",
"npm": "^9"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does this affect pnpm?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants