How to upgrade node js version from 16 to >=18

I used “bench get-app hrms” command for get hrms app.
but i got some error

:~/frappe-bench$ bench get-app hrms
Getting hrms
$ git clone GitHub - frappe/hrms: Open Source HR and Payroll Software --depth 1 --origin upstream
Cloning into ‘hrms’…
remote: Enumerating objects: 1488, done.
remote: Counting objects: 100% (1488/1488), done.
remote: Compressing objects: 100% (1133/1133), done.
remote: Total 1488 (delta 404), reused 792 (delta 300), pack-reused 0 (from 0)
Receiving objects: 100% (1488/1488), 8.01 MiB | 1.51 MiB/s, done.
Resolving deltas: 100% (404/404), done.
Installed frappe-dependency ‘frappe’ version ‘14.80.1’ does not satisfy required version ‘>=16.0.0-dev,<17.0.0’. App ‘hrms’ might not work as expected.
Installed frappe-dependency ‘erpnext’ version ‘14.73.0’ does not satisfy required version ‘>=16.0.0-dev,<17.0.0’. App ‘hrms’ might not work as expected.
Ignoring dependencies of hrms. To install dependencies use --resolve-deps
Installing hrms
$ /home/sumith/frappe-bench/env/bin/python -m pip install --quiet --upgrade -e /home/sumith/frappe-bench/apps/hrms
$ yarn install --check-files
yarn install v1.22.22
[1/4] Resolving packages…
[2/4] Fetching packages…
warning Pattern [“wrap-ansi@^7.0.0”] is trying to unpack in the same destination “/home/sumith/.cache/yarn/v6/npm-wrap-ansi-cjs-7.0.0-67e145cff510a6a6984bdf1152911d69d2eb9e43-integrity/node_modules/wrap-ansi-cjs” as pattern [“wrap-ansi-cjs@npm:wrap-ansi@^7.0.0”]. This could result in non-deterministic behavior, skipping.
error vite@5.2.12: The engine “node” is incompatible with this module. Expected version “^18.0.0 || >=20.0.0”. Got “16.15.0”
error Found incompatible module.
info Visit yarn install | Yarn for documentation about this command.
ERROR: yarn install --check-files
subprocess.CalledProcessError: Command ‘yarn install --check-files’ returned non-zero exit status 1.

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/local/bin/bench”, line 8, in
sys.exit(cli())
File “/usr/local/lib/python3.10/dist-packages/bench/cli.py”, line 132, in cli
bench_command()
File “/usr/local/lib/python3.10/dist-packages/bench/commands/make.py”, line 181, in get_app
get_app(
File “/usr/local/lib/python3.10/dist-packages/bench/app.py”, line 777, in get_app
app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
File “/usr/local/lib/python3.10/dist-packages/bench/utils/render.py”, line 126, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.10/dist-packages/bench/app.py”, line 254, in install
install_app(
File “/usr/local/lib/python3.10/dist-packages/bench/app.py”, line 920, in install_app
bench.run(yarn_install, cwd=app_path)
File “/usr/local/lib/python3.10/dist-packages/bench/bench.py”, line 48, in run
return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
File “/usr/local/lib/python3.10/dist-packages/bench/utils/init.py”, line 178, in exec_cmd
raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: yarn install --check-files

I think i got node -v 16 is problem. how can i upgrade “^18.0.0 || >=20.0.0”.

@Sumith-2004 check this upgrade - Upgrading Node.js to the latest version - Stack Overflow

1 Like