nf-core / actions-runners

Instructions and scripts for custom GitHub Actions runners
MIT License
2 stars 3 forks source link

Messing with npm #1

Closed ewels closed 1 year ago

ewels commented 1 year ago

Not totally sure about this, so want to check via a PR.

Context: Actions run such as this

image
Run prettier --check ${GITHUB_WORKSPACE}
  prettier --check ${GITHUB_WORKSPACE}
  shell: /usr/bin/bash -e {0}
/home/runner/work/_temp/b96948f7-6f81-4198-adee-e9[2](https://github.com/nf-core/nf-co.re/actions/runs/4531199448/jobs/7981062177#step:5:2)e[3](https://github.com/nf-core/nf-co.re/actions/runs/4531199448/jobs/7981062177#step:5:3)5e1[4](https://github.com/nf-core/nf-co.re/actions/runs/4531199448/jobs/7981062177#step:5:5)ba9.sh: line 1: prettier: command not found
Error: Process completed with exit code 127.

Logging into the EC2 instance as the runner user and doing:

npm config set prefix /usr/local
npm install -g prettier

seems to have fixed it. Hence my proposed changes here.

Sort of fumbling in the dark here though, would be curious about the previous prefix logic which I didn't see until now @apeltzer