Skip to content

Commit

Permalink
node installation: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
jstucke committed May 2, 2024
1 parent db8ccaf commit bdc2f5b
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/install/frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,10 @@ def _install_nodejs(nodejs_version: str = '22'):
if Path(NODEENV_DIR).is_dir():
logging.info('Skipping nodeenv installation (already exists)')
else:
_set_up_nodeenv(latest_version)
run_cmd_with_logging(f'nodeenv {NODEENV_DIR} --node={latest_version} --prebuilt')
run_cmd_with_logging(f'. {NODEENV_DIR}/bin/activate && npm install --no-fund .', shell=True)


def _set_up_nodeenv(nodejs_version: str):
latest_version = _find_latest_node_version(nodejs_version)
run_cmd_with_logging(f'nodeenv {NODEENV_DIR} --node={latest_version} --prebuilt')


def _find_latest_node_version(target_version: str) -> str:
proc = subprocess.run(split('nodeenv --list'), capture_output=True, text=True, check=False)
if proc.returncode != 0:
Expand Down

0 comments on commit bdc2f5b

Please sign in to comment.