Circle CI build failed
See original GitHub issueWhen I try to run tests with Circle CI
v2 using npm
, build fails after running npm ci
:
#!/bin/bash -eo pipefail
npm ci
/bin/bash: npm: command not found
Exited with code 127
This is my circleci.yml config:
version: 2
jobs:
build:
working_directory: /var/www
docker:
# using custom image, see .circleci/images/primary/Dockerfile
- image: circleci/cci-demo-docker-primary:0.0.2
- image: cypress/base:8
environment:
...
TERM: xterm
parallelism: 1
steps:
- checkout
- run:
...
- restore_cache:
key: v2-deps-{{ .Branch }}-{{ checksum "package.json" }}
key: v2-deps-{{ .Branch }}-
key: v2-deps-
- run: npm ci
- save_cache:
key: v2-deps-{{ .Branch }}-{{ checksum "package.json" }}
paths:
- ~/.npm
- ~/.cache
- run: $(npm bin)/cypress run --record --key <my_record_key>
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
CircleCi build failed - Build Environment
Hi, Sometimes i get build failed in CircleCi for first time, and if i rebuild the test it works well, i don't know...
Read more >Exit Build Early if Any Test Fails - CircleCI Support
Cancel On Test Fail Using API Some notes about the above solution: It will cancel the workflow instead of moving it to a...
Read more >Build Fails Using 'apt-get update' Command - CircleCI Support
We're starting to see reports of CircleCI builds failing due to an error when running apt-get update . The problem we're tracking is...
Read more >Troubleshooting Unexplained Build Failures - CircleCI
Just remember, the next time that your build spontaneously fails, it is because something has changed. Fortunately, CircleCI provides solutions ...
Read more >How I learned to stop worrying and love failed builds - CircleCI
Real failures Getting a red build isn't a failure. But there are certainly scenarios in CI which are real failures, and which are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@stephyswe Late reply, but you can replace
npm ci
withyarn install --frozen-lockfile
. Rest should run just fine with npm commands used in the examples they provide, I believe.@saadaouad You’ll need to run
npm i
locally in order to generate and commit thepackage-lock.json
file to be read by your CI. Thenpm ci
command exclusively uses thepackage-lock.json
file.