fix(ci): use Node.js image and fix cache ordering#5
Draft
circleci-app[bot] wants to merge 1 commit intomasterfrom
Draft
fix(ci): use Node.js image and fix cache ordering#5circleci-app[bot] wants to merge 1 commit intomasterfrom
circleci-app[bot] wants to merge 1 commit intomasterfrom
Conversation
**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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prompt Given
Fix build (120), with failed step Checkout code
Root cause: The CI pipeline used
cimg/base:currentas the Docker image, which does not include Node.js or npm. This caused thenpm installstep to fail immediately. Additionally,restore_cachewas placed afternpm install, meaning the dependency cache was never actually restored before installation ran.Fix approach: Switch the Docker image to
cimg/node:ltswhich includes Node.js and npm pre-installed. Reorder the steps sorestore_cacheruns beforenpm installto 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:
cimg/base:currenttocimg/node:ltsto provide npm/Node.jsrestore_cachestep beforenpm installso cached dependencies are restored prior to installationFix SSH key permissionsstep (not needed with Node image)Upgrade gitstep (not needed with Node image)View more about this proposed fix in the CircleCI web app →