Unable to build on cimg/node:18.0 "yarn not found"

Build error after checkout step with the message:

#!/bin/bash -eo pipefail
sudo yarn global add npx

Yarn requires Node.js 4.0 or higher to be installed.

Workaround: downgrade to cimg/node:17.6

Both - run: node --version and - run: yarn -v triggered similar errors.
Has anything changed with recent cimg/node versions ?

Repro

version: 2.1

workflows:
  version: 2
  build:
    jobs:
      - build

jobs:
  build:
    docker:
      - image: cimg/node:current
    steps:
      - checkout
      - run:
          command: sudo yarn global add npx

Update:

Solution was to remove sudo as per Release v12.13.1 v14.19.2 and more by JalexChen · Pull Request #237 · CircleCI-Public/cimg-node · GitHub