#!/bin/bash -eo pipefail
if [ ! -f "package.json" ]; then
echo
echo "---"
echo "Unable to find your package.json file. Did you forget to set the app-dir parameter?"
echo "---"
echo
echo "Current directory: $(pwd)"
echo
echo
echo "List directory: "
echo
ls
exit 1
fi
Can you post your working config.yml? I’m having the same issue.
---
Unable to find your package.json file. Did you forget to set the app-dir parameter?
---
Current directory: /home/circleci/project/backend
List directory:
backend README.md
frontend LICENSE
Exited with code exit status 1
CircleCI received exit code 1
config.yml file
# Use the latest 2.1 version of CircleCI pipeline process engine.
# See: https://circleci.com/docs/2.0/configuration-reference
version: 2.1
orbs:
node: circleci/node@4.1
# The heroku orb contains a set of prepackaged CircleCI configuration you can utilize to deploy applications to heroku
# Orbs reduce the amount of configuration required for common tasks.
# See the orb documentation here: https://circleci.com/developer/orbs/orb/circleci/heroku
# NOTE: Environment variables containing the necessary secrets can be setup in the CircleCI UI
# See here https://circleci.com/docs/2.0/env-vars/#setting-an-environment-variable-in-a-project
heroku: circleci/heroku@1.2
jobs:
build:
working_directory: ~/project/backend
# Reuse Docker container specification given by the node Orb
executor: node/default
steps:
- checkout
# Install the latest npm - the node Orb takes care of it
- node/install-npm
- node/install-packages:
app-dir: ~/project/backend
cache-version: v1
cache-path: node_modules
- run:
app-dir: ~/project/backend
cache-version: v1
command: npm run build
name: Build
workflows:
# Below is the definition of your workflow.
# Inside the workflow, you provide the jobs you want to run, e.g this workflow runs the build-and-test job above.
# CircleCI will run this workflow on every commit.
# For more details on extending your workflow, see the configuration docs: https://circleci.com/docs/2.0/configuration-reference/#workflows
sample:
jobs:
- build
- heroku/deploy-via-git:
force: true # this parameter instructs the push to use a force flag when pushing to the heroku remote, see: https://devcenter.heroku.com/articles/git
requires:
- build # only run deploy-via-git job if the build job has completed
filters:
branches:
# This sample config runs this job on any branch matching the regex below, however, it's more likely you want to only run this job on master.
only: /.*-heroku-deploy/ # Delete this line
# only: master # Uncomment this line
They seem to have changed - to Yes/No but it’s still not clear what the solution is. Are failed builds cached and forever doomed until you increment “cache-version” to get rid of it?