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 fails stating sudo command not found #208

Open
aquacode opened this issue Feb 14, 2024 · 1 comment
Open

install-yarn fails stating sudo command not found #208

aquacode opened this issue Feb 14, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@aquacode
Copy link

aquacode commented Feb 14, 2024

Orb version:

5.2.0

What happened:

I'm using node-orb 5.2.0 on a CircleCI Windows image based on the Orb circleci/windows version 2.2.0

I'm using the following config:

manage-node-npm: description: "Install node and yarn". steps: - node/install: install-yarn: true. node-version: "14.18.0".

Expected behavior:

install-yarn should succeed but instead I see the following output:

Latest version of Yarn is 1.22.21
Checking if YARN is already installed...
Installing YARN v1.22.21
bash: line 56: sudo: command not found
bash: line 58: sudo: command not found
bash: line 59: sudo: command not found
bash: line 61: sudo: command not found
bash: line 63: sudo: command not found
bash: line 65: sudo: command not found
bash: line 66: sudo: command not found
bash: line 67: sudo: command not found
bash: line 69: sudo: command not found
bash: line 75: sudo: command not found
bash: line 76: sudo: command not found
Verifying YARN install
bash: line 81: yarn: command not found
Something went wrong; the specified version of Yarn could not be installed

Exited with code exit status 1

Additional Information:

This used to work and suddenly it isn't

@aquacode aquacode added the bug Something isn't working label Feb 14, 2024
@marboledacci
Copy link
Contributor

This orb is not fully compatible with windows, so it is trying to install using linux commands.
Fortunately the windows images come with node installed, so you can take advantage of corepack to install yarn.
Just add a new step before the install command, and run corepack enable. With this, yarn will be installed so the command won't try to reinstall and fail.

The update for your configuration would be like this:

  manage-node-npm:
    steps:
      - run: corepack enable
      - node/install:
          install-yarn: true
          node-version: "14.18.0"

@marboledacci marboledacci self-assigned this Aug 30, 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

2 participants