CodexBloom - Programming Q&A Platform

GitHub Actions scenarios with 'No matching version found for dependency' scenarios during CI build

πŸ‘€ Views: 0 πŸ’¬ Answers: 1 πŸ“… Created: 2025-06-14
github-actions npm ci node.js JavaScript

Hey everyone, I'm running into an issue that's driving me crazy. I tried several approaches but none seem to work. I'm running a CI pipeline using GitHub Actions to build a Node.js application, and I'm working with a frustrating scenario. The pipeline fails at the step where it installs dependencies, returning the behavior message: `No matching version found for my-package@^1.2.3`. I've double-checked the package.json file, and the dependency is correctly specified as: ```json "my-package": "^1.2.3" ``` I verified that version 1.2.3 exists on npm by checking the package's page. To troubleshoot, I tried refreshing the npm cache by adding `npm cache clean --force` before the installation step in my workflow file, but the scenario continues. Here’s a snippet of my GitHub Actions workflow: ```yaml name: CI on: push: branches: - main jobs: build: runs-on: ubuntu-latest steps: - name: Checkout code uses: actions/checkout@v2 - name: Set up Node.js uses: actions/setup-node@v2 with: node-version: '14' - name: Install dependencies run: | npm cache clean --force npm install - name: Run tests run: npm test ``` Additionally, I checked if the version range might be conflicting with the package-lock.json, but removing it and running `npm install` locally works fine without errors. I also verified there are no typos in the package name. Could this be related to the GitHub Actions runner's environment? Is there a way to further diagnose the scenario or ensure that the correct versions are being resolved during the CI build? For context: I'm using Javascript on Ubuntu. For context: I'm using Javascript on Ubuntu. How would you solve this?