diff --git a/bench/patches/v4/install_yarn.py b/bench/patches/v4/install_yarn.py index a9ef438e..e29868e9 100644 --- a/bench/patches/v4/install_yarn.py +++ b/bench/patches/v4/install_yarn.py @@ -1,4 +1,5 @@ -import subprocess +import os +from bench.utils import exec_cmd def execute(bench_path): - subprocess.check_output(['sudo', 'npm', 'install', '-g', 'yarn']) \ No newline at end of file + exec_cmd('npm install yarn', os.path.join(bench_path, 'apps/frappe')) diff --git a/bench/utils.py b/bench/utils.py index 6a2d77df..37f27853 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -434,7 +434,7 @@ def update_npm_packages(bench_path='.'): for app in os.listdir(apps_dir): app_path = os.path.join(apps_dir, app) if os.path.exists(os.path.join(app_path, 'package.json')): - exec_cmd('yarn install', cwd=app_path) + exec_cmd('./node_modules/.bin/yarn install', cwd=app_path) def install_requirements(pip, req_file):