CircleCI-Public / node-orb

An orb for working with Node.js on CircleCI
https://circleci.com/orbs/registry/orb/circleci/node
MIT License
52 stars 80 forks source link

Inability to install requested NodeJS version does not break the build #192

Open roblillack opened 1 year ago

roblillack commented 1 year ago

Orb version:

circleci/node@5.1.0

What happened:

Both the "Install Node.js" and "Activate installed node version" steps are marked as successful—even though both of them failed.

image

Workflow: https://app.circleci.com/pipelines/github/vizzlo/web/20167/workflows/add62e32-3990-4089-bf53-857b132fc7bd/jobs/95940

Expected behavior:

Break the build, if the requested Node version cannot be installed for whatever reason

marboledacci commented 1 week ago

Hi @roblillack I noticed you are using windows with bash here, by default unix executors add the -eo pipefail to the shell, so this is granted. For windows, you have to manually add this when setting the shell. The correct way to get the behavior you want would be:

    machine:
      image: 'windows-server-2022-gui:current'
      resource_class: windows.medium
      shell: bash.exe -eo pipefail

If you are using the windows orb, it would be the same, just add -eo pipefail after bash.exe.