npx semantic-release does not work when using nvm for node versioning #2714
-
Current behaviorWhen running my CI, the npx semantic-release throws an error: [semantic-release]: node version >=18 is required. Found v16.19.0. My workflow file looks like this: name: Release
on:
push:
branches:
- main
jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set the correct Node version using nvm
shell: bash -l {0}
run: nvm install
- name: Install dependencies
run: npm ci
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npx semantic-release And the .nvmrc file specifies the version 18.14.0 which is truly picked up after the Now using node v18.14.0 (npm v9.3.1) Expected behaviorI would expect the semantic-release to successfully execute, given that the task before did pick up the correct node version.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
is your nvm command impacting other steps in a way that you are confident that it was effective? i typically use the setup-node action to handle configuring the environment according the the version configured for use by nvm, like: https://github.com/form8ion/project/blob/6e92fde981ad988de6f2183272d6825a600a400d/.github/workflows/node-ci.yml#L22-L25 |
Beta Was this translation helpful? Give feedback.
is your nvm command impacting other steps in a way that you are confident that it was effective? i typically use the setup-node action to handle configuring the environment according the the version configured for use by nvm, like: https://github.com/form8ion/project/blob/6e92fde981ad988de6f2183272d6825a600a400d/.github/workflows/node-ci.yml#L22-L25