bench.exceptions.CommandFailedError ( After running bench update)

gyp ERR! cwd /home/frappe/frappe-bench/apps/frappe/node_modules/node-sass
gyp ERR! node -v v16.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
Build failed with error code: 1
info Visit yarn install | Yarn for documentation about this
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 8, in
File “/usr/local/lib/python3.6/dist-packages/bench/”, line 121, in cli
raise e
File “/usr/local/lib/python3.6/dist-packages/bench/”, line 111, in cli
File “/usr/local/lib/python3.6/dist-packages/click/”, line 764, in ca ll
return self.main(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/click/”, line 717, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python3.6/dist-packages/click/”, line 1137, in inv oke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.6/dist-packages/click/”, line 1137, in inv oke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.6/dist-packages/click/”, line 956, in invo ke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python3.6/dist-packages/click/”, line 555, in invo ke
return callback(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/bench/commands/”, line 15 5, in setup_requirements
File “/usr/local/lib/python3.6/dist-packages/bench/utils/”, line 95, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/bench/”, line 342, in req uirements
App(app, bench=self.bench, to_clone=False).install( skip_assets=True, restar t_bench=False)
File “/usr/local/lib/python3.6/dist-packages/bench/utils/”, line 110, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/bench/”, line 203, in insta ll
File “/usr/local/lib/python3.6/dist-packages/bench/”, line 428, in insta ll_app“yarn install”, cwd=app_path)
File “/usr/local/lib/python3.6/dist-packages/bench/”, line 43, in run
return exec_cmd(cmd, cwd=cwd or self.cwd)
File “/usr/local/lib/python3.6/dist-packages/bench/utils/”, line 12 6, in exec_cmd
raise CommandFailedError

Tough to say without a bit more information. My guess is you want to check if the version of node-sass (specified in the 'package.json' for Frappe) is compatible with the version of Node you have installed on your machine.

Compatibility matrix here.

From your error text, looks like you have Node v16.15. So you’ll need a ‘node-sass’ of v6.x


I can confirm that I had a lot of trouble with node-sass on node v16. My solution was to use nvm to switch back to node v14.


Thanks !!! This worked for me as well.

Greate I got error while installing the frappe-bench 14 when I run this command

PYENV_VERSION=3.10.12 bench init --skip-redis-config-generation --frappe-branch version-14 frappe-bench

I’m getting this error.

yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
error An unexpected error occurred: " getaddrinfo EAI_AGAIN".
info If you think this is a bug, please open a bug report with the information provided in "/workspace/development/frappe-bench/apps/frappe/yarn-error.log".
info Visit for documentation about this command.
subprocess.CalledProcessError: Command 'yarn install' returned non-zero exit status 1.

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

Traceback (most recent call last):
  File "/home/frappe/.bench/bench/commands/", line 68, in init
  File "/home/frappe/.bench/bench/utils/", line 105, in wrapper_fn
    return fn(*args, **kwargs)
  File "/home/frappe/.bench/bench/utils/", line 79, in init
  File "/home/frappe/.bench/bench/", line 444, in get_app
    app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
  File "/home/frappe/.bench/bench/utils/", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/home/frappe/.bench/bench/", line 242, in install
  File "/home/frappe/.bench/bench/", line 581, in install_app"yarn install", cwd=app_path)
  File "/home/frappe/.bench/bench/", line 48, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
  File "/home/frappe/.bench/bench/utils/", line 158, in exec_cmd
    raise CommandFailedError(cmd) from subprocess.CalledProcessError(return_code, cmd)
bench.exceptions.CommandFailedError: yarn install

ERROR: There was a problem while creating frappe-bench

After that I ran this command because im using node v16 to activate note use this command nvm use v16 node-sass

npm i node-sass@6.0.1

After that, I can install it successfully. thank you