Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

install-yarn does not work on machine executors #212

Open
blimmer opened this issue Mar 6, 2024 · 0 comments
Open

install-yarn does not work on machine executors #212

blimmer opened this issue Mar 6, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@blimmer
Copy link
Contributor

blimmer commented Mar 6, 2024

Orb version:

5.2.0

What happened:

Latest version of Yarn is 1.22.21
Checking if YARN is already installed...
A different version of Yarn is installed (1.22.19); removing it
^@^@Installing YARN v1.22.21
Verifying YARN install
Something went wrong; the specified version of Yarn could not be installed

Exited with code exit status 1

Expected behavior:

The newer version of yarn should be installed without the error.

Additional Information:

The script installs the newer version of yarn to /usr/local/bin/yarn. However, on this machine executor (ubuntu-2204:2024.01.1), yarn is being pulled from nvm:

circleci@ip-10-0-169-43:~$ which yarn
/opt/circleci/.nvm/versions/node/v20.10.0/bin/yarn

Which is earlier in the PATH:

circleci@ip-10-0-169-43:~$ echo $PATH
/home/circleci/.go_workspace/bin:/usr/local/go/bin:/opt/google/google-cloud-sdk/bin:/opt/circleci/.rbenv/shims:/opt/circleci/.rbenv/bin:/opt/circleci/.pyenv/shims:/opt/circleci/.pyenv/bin:/usr/local/apache-maven/bin:/home/circleci/.yarn/bin:/home/circleci/.config/yarn/global/node_modules/.bin:/home/circleci/bin:/home/circleci/.go_workspace/bin:/usr/local/go/bin:/opt/google/google-cloud-sdk/bin:/opt/circleci/.rbenv/shims:/opt/circleci/.rbenv/bin:/opt/circleci/.pyenv/shims:/opt/circleci/.pyenv/bin:/usr/local/apache-maven/bin:/home/circleci/.yarn/bin:/home/circleci/.config/yarn/global/node_modules/.bin:/opt/circleci/.nvm/versions/node/v20.10.0/bin:/home/circleci/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin:/usr/local/gradle-8.5/bin:/usr/local/gradle-8.5/bin

So the newer version being installed does not pass the final check

# test/verify version
echo "Verifying YARN install"
if yarn --version | grep "$YARN_ORB_VERSION" > /dev/null 2>&1; then
echo "Success! Yarn $(yarn --version) has been installed to $(command -v yarn)"
else
echo "Something went wrong; the specified version of Yarn could not be installed"
exit 1
fi

@blimmer blimmer added the bug Something isn't working label Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant