Fix error "nvm not found" in CircleCI workflows #3990
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes the error
nvm: command not foundthat is shown in some steps of the CircleCI workflows like "Check correctness":https://app.circleci.com/pipelines/github/wordpress-mobile/gutenberg-mobile/14186/workflows/9eb80d13-b000-4ad3-b494-b2999c204598/jobs/77249
The issue was caused when running bash scripts, as far as I checked, before executing the script, it was running the command
nvm use defaultthat is set in the Bash environment ($BASH_ENV) but failed due to not having the commandnvmdefined. This was fixed by adding the NVM loading command to the Bash environment that assures that NVM will be always available.To test:
Verify that all CI checks pass and that the error is no longer shown in the logs.
Last "Check correctness" run job:
https://app.circleci.com/pipelines/github/wordpress-mobile/gutenberg-mobile/14161/workflows/a43133cd-e79f-43d4-9b27-97998319ab71/jobs/77133?invite=true#step-110-3
PR submission checklist: