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
ERROR:
Traceback (most recent call last):
File “/usr/local/bin/bench”, line 8, in
sys.exit(cli())
File “/usr/local/lib/python3.6/dist-packages/bench/cli.py”, line 121, in cli
raise e
File “/usr/local/lib/python3.6/dist-packages/bench/cli.py”, line 111, in cli
bench_command()
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 764, in ca ll
return self.main(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 717, in main
rv = self.invoke(ctx)
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 1137, in inv oke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 1137, in inv oke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 956, in invo ke
return ctx.invoke(self.callback, **ctx.params)
File “/usr/local/lib/python3.6/dist-packages/click/core.py”, line 555, in invo ke
return callback(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/bench/commands/setup.py”, line 15 5, in setup_requirements
bench.setup.requirements(apps=apps)
File “/usr/local/lib/python3.6/dist-packages/bench/utils/render.py”, line 95, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/bench/bench.py”, 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/render.py”, line 110, in wrapper_fn
return fn(*args, **kwargs)
File “/usr/local/lib/python3.6/dist-packages/bench/app.py”, line 203, in insta ll
restart_bench=restart_bench
File “/usr/local/lib/python3.6/dist-packages/bench/app.py”, line 428, in insta ll_app
bench.run(“yarn install”, cwd=app_path)
File “/usr/local/lib/python3.6/dist-packages/bench/bench.py”, line 43, in run
return exec_cmd(cmd, cwd=cwd or self.cwd)
File “/usr/local/lib/python3.6/dist-packages/bench/utils/init.py”, line 12 6, in exec_cmd
raise CommandFailedError
bench.exceptions.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

2 Likes

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.

2 Likes

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: "https://registry.yarnpkg.com/codex-notifier/-/codex-notifier-1.1.2.tgz: getaddrinfo EAI_AGAIN registry.yarnpkg.com".
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 https://yarnpkg.com/en/docs/cli/install 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/make.py", line 68, in init
    init(
  File "/home/frappe/.bench/bench/utils/render.py", line 105, in wrapper_fn
    return fn(*args, **kwargs)
  File "/home/frappe/.bench/bench/utils/system.py", line 79, in init
    get_app(
  File "/home/frappe/.bench/bench/app.py", line 444, in get_app
    app.install(verbose=verbose, skip_assets=skip_assets, restart_bench=restart_bench)
  File "/home/frappe/.bench/bench/utils/render.py", line 126, in wrapper_fn
    return fn(*args, **kwargs)
  File "/home/frappe/.bench/bench/app.py", line 242, in install
    install_app(
  File "/home/frappe/.bench/bench/app.py", line 581, in install_app
    bench.run("yarn install", cwd=app_path)
  File "/home/frappe/.bench/bench/bench.py", line 48, in run
    return exec_cmd(cmd, cwd=cwd or self.cwd, _raise=_raise)
  File "/home/frappe/.bench/bench/utils/__init__.py", 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