Select Node version

Since few days ago, I started getting this error on CircleCI:

> setup:js
> npm install && npm install --prefix themes/mytheme

npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine Not compatible with your version of node/npm: undefined
npm ERR! notsup Not compatible with your version of node/npm: undefined
npm ERR! notsup Required: {"node":">=18.0.0","npm":">=8.0.0"}
npm ERR! notsup Actual:   {"npm":"8.19.4","node":"v16.20.2"}

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-12-07T21_56_30_733Z-debug-0.log

Exited with code exit status 1

I tried adding this:

- run:
          name: Install Node 18
          command: |
            nvm install 18

      - run:
          name: Choose Node version
          command: |
            nvm use 18

But still getting the same error.
Does anyone have idea how I can solve this? Thanks.

Which system image are you using for your environment?

Thanks for reply @rit1010

We are using 10up/wordpress-ci:php-8.1, but issue has been resolved.
We found the problematic dependency, sharp, and downgraded it to a version compatible with node 16:

sharp@0.32.6
1 Like

Hi @tahireu, just in case you’re not aware, Node 16 went end of life back in September.

It’s annoying (especially as the EOL date got brought forward) but I’m sorry to say you would be well advised to upgrade to 18 sooner rather than later.