Error: Composer could not find a composer.json file

I’m trying to setup a basic workflow with Circle CI but I’m experiencing an issue with composer.
For some reason I am receiving the following error when running a build:

Composer could not find a composer.json file in /home/circleci

However there is DEFINITELY a composer.json file there, so I’m not sure what’s going wrong.

Here is my config.yml:

# PHP CircleCI 2.0 configuration file
# Check for more details
version: 2
      # specify the version you desire here
      - image: circleci/php:7.1-node-browsers
      # Specify service dependencies here if necessary
      # CircleCI maintains a library of pre-built images
      # documented at
      # - image: circleci/mysql:9.4

    working_directory: ~/CRM

      - checkout

      # Download and cache dependencies
      - restore_cache:
          - v1-dependencies-{{ checksum "composer.json" }}
          # fallback to using the latest cache if no exact match is found
          - v1-dependencies-

      - run: composer install -n --prefer-dist

       - save_cache:
             - ./vendor
           key: v1-dependencies-{{ checksum "composer.json" }}
      # run tests!
      - run: phpunit

Any ideas?

1 Like

Apologies, I’ve updated the post now.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.