Skip to content

fix(ci): use Node.js image and fix cache ordering#5

Draft
circleci-app[bot] wants to merge 1 commit intomasterfrom
chunk/changes-1774086585920-1774086585920
Draft

fix(ci): use Node.js image and fix cache ordering#5
circleci-app[bot] wants to merge 1 commit intomasterfrom
chunk/changes-1774086585920-1774086585920

Conversation

@circleci-app
Copy link
Copy Markdown

@circleci-app circleci-app bot commented Mar 21, 2026

Prompt Given

Fix build (120), with failed step Checkout code

Root cause: The CI pipeline used cimg/base:current as the Docker image, which does not include Node.js or npm. This caused the npm install step to fail immediately. Additionally, restore_cache was placed after npm install, meaning the dependency cache was never actually restored before installation ran.

Fix approach: Switch the Docker image to cimg/node:lts which includes Node.js and npm pre-installed. Reorder the steps so restore_cache runs before npm install to properly leverage caching. Remove the now-unnecessary SSH key permission fix and git upgrade workaround steps that were added as workarounds for the base image limitations.

Changes made:

  • Changed Docker image from cimg/base:current to cimg/node:lts to provide npm/Node.js
  • Moved restore_cache step before npm install so cached dependencies are restored prior to installation
  • Removed Fix SSH key permissions step (not needed with Node image)
  • Removed Upgrade git step (not needed with Node image)

View more about this proposed fix in the CircleCI web app →

**Root cause:** The CI pipeline used `cimg/base:current` as the Docker image, which does not include Node.js or npm. This caused the `npm install` step to fail immediately. Additionally, `restore_cache` was placed after `npm install`, meaning the dependency cache was never actually restored before installation ran.

**Fix approach:** Switch the Docker image to `cimg/node:lts` which includes Node.js and npm pre-installed. Reorder the steps so `restore_cache` runs before `npm install` to properly leverage caching. Remove the now-unnecessary SSH key permission fix and git upgrade workaround steps that were added as workarounds for the base image limitations.

**Changes made:**
- Changed Docker image from `cimg/base:current` to `cimg/node:lts` to provide npm/Node.js
- Moved `restore_cache` step before `npm install` so cached dependencies are restored prior to installation
- Removed `Fix SSH key permissions` step (not needed with Node image)
- Removed `Upgrade git` step (not needed with Node image)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants