Skip to content

Build error when using the current Node LTS v18 #230

Open
@Jinksi

Description

Describe the bug

The Long Term Support (LTS) version of Node.js is now 18.x. source

Currently, when running on node v18, npm run build results in the error below.

wp-scripts build assets/src/js/index.js

node_modules/loader-runner/lib/LoaderRunner.js:114
                        throw e;
                        ^

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

We support the LTS version of node in .nvmrc, so we should ensure that our dev tooling works with the new LTS version.

To Reproduce

  1. Checkout trunk
  2. Install the latest LTS version of node by running nvm install from this repo's directory.
  3. Run nvm use, you should now be using Node v18.x.
  4. Run npm install. Notice an Unsupported engine warning.
    npm WARN EBADENGINE Unsupported engine {
    npm WARN EBADENGINE   package: '[email protected]',
    npm WARN EBADENGINE   required: { node: '^16.17.1', npm: '^8.15.0' },
    npm WARN EBADENGINE   current: { node: 'v18.12.0', npm: '8.19.2' }
    npm WARN EBADENGINE }
    
  5. Run npm run build. Notice the wp-scripts error as mentioned above.

Product impact

  • Does this issue affect WooCommerce Subscriptions? no
  • Does this issue affect WooCommerce Payments? no

Metadata

Assignees

Labels

type: bugThe issue is a confirmed bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions