Config.yml error

I’m having a bit of an issue getting my config.yml to work. Here is my config.yml below:

    version: 2.1

executors:
  node-executor:
    docker:
      - image: circleci/node:10

jobs:
  deploy-dev:
    executor: node-executor
    environment:
      NETLIFY_SITE_ID: $NETLIFY_DEV_SITE_ID
      NETLIFY_ACCESS_TOKEN: $NETLIFY_ACCESS_TOKEN
    working_directory: ~/repo
    steps:
      - run:
          name: Netlify Deploy
          command: ./node_modules/.bin/netlify deploy --site $NETLIFY_SITE_ID --auth $NETLIFY_ACCESS_TOKEN --dir=public
  deploy-prod:
    executor: node-executor
    environment:
      NETLIFY_SITE_ID: $NETLIFY_PROD_SITE_ID
      NETLIFY_ACCESS_TOKEN: $NETLIFY_ACCESS_TOKEN
    working_directory: ~/repo
    steps:
      - run:
          name: Netlify Deploy
          command: ./node_modules/.bin/netlify deploy --site $NETLIFY_SITE_ID --auth $NETLIFY_ACCESS_TOKEN --prod --dir=public
  build-dev:
    steps:
      - checkout
      - restore_cache:
          keys:
            - v1-npm-deps-{{ checksum "package-lock.json" }}
            - v1-npm-deps-
      - run:
          name: Install Dependencies
          command: npm install
      - save_cache:
          keys:
            - v1-dependencies-{{ checksum "package.json" }}
            - v1-dependencies-
          paths:
            - ./node_modules
      - restore_cache:
          keys:
            - v1-npm-deps-{{ checksum "package-lock.json" }}
            - v1-npm-deps-
      - run:
          name: Build Dev
          command: npm run build:staging
      - save_cache:
          keys:
            - v1-dependencies-{{ checksum "package.json" }}
            - v1-dependencies-
          paths:
            - ./public
  build-prod:
    steps:
      - checkout
      - restore_cache:
          keys:
            - v1-npm-deps-{{ checksum "package-lock.json" }}
            - v1-npm-deps-
      - run:
          name: Install Dependencies
          command: npm install
      - save_cache:
          keys:
            - v1-dependencies-{{ checksum "package.json" }}
            - v1-dependencies-
          paths:
            - ./node_modules
      - restore_cache:
          keys:
            - v1-npm-deps-{{ checksum "package-lock.json" }}
            - v1-npm-deps-
      - run:
          name: Build Prod
          command: npm run build:production
      - save_cache:
          keys:
            - v1-dependencies-{{ checksum "package.json" }}
            - v1-dependencies-
          paths:
            - ./public

workflows:
  version: 2
  build-deploy:
    jobs:
      - build-dev
      - deploy-dev:
          requires:
            - build-dev
      - hold:
          type: approval
          requires:
            - build-dev
            - deploy-dev
      - build-prod:
          requires:
            - hold
      - deploy-prod:
          requires:
            - build-prod

Below are the errors I seem to be getting:

    ERROR IN CONFIG FILE:

[#/jobs] 10 schema violations found

Any string key is allowed as job name.

1. [#/jobs/build-dev] 0 subschemas matched instead of one

|   1. [#/jobs/build-dev] only 1 subschema matches out of 2

|   |   1. [#/jobs/build-dev] no subschema matched out of the total 2 subschemas

|   |   |   1. [#/jobs/build-dev] 0 subschemas matched instead of one

|   |   |   |   1. [#/jobs/build-dev] required key [docker] not found

|   |   |   |   2. [#/jobs/build-dev] required key [machine] not found

|   |   |   |   3. [#/jobs/build-dev] required key [macos] not found

|   |   |   2. [#/jobs/build-dev] required key [executor] not found

|   |   |   |   A job must have one of `docker`, `machine`, `macos` or `executor` (which can provide docker/machine/macos information).

|   2. [#/jobs/build-dev] expected type: String, found: Mapping

|   |   Job may be a string reference to another job

2. [#/jobs/build-prod] 0 subschemas matched instead of one

|   1. [#/jobs/build-prod] only 1 subschema matches out of 2

|   |   1. [#/jobs/build-prod] no subschema matched out of the total 2 subschemas

|   |   |   1. [#/jobs/build-prod] 0 subschemas matched instead of one

|   |   |   |   1. [#/jobs/build-prod] required key [docker] not found

|   |   |   |   2. [#/jobs/build-prod] required key [machine] not found

|   |   |   |   3. [#/jobs/build-prod] required key [macos] not found

|   |   |   2. [#/jobs/build-prod] required key [executor] not found

|   |   |   |   A job must have one of `docker`, `machine`, `macos` or `executor` (which can provide docker/machine/macos information).

|   2. [#/jobs/build-prod] expected type: String, found: Mapping

|   |   Job may be a string reference to another job

Thanks for the help in advance. Been going round in circles on this.

Hi @jameslevine! Welcome to the CircleCI community!

The content of your config.yml shows that the configuration version key is indented. As it’s a top-level key, there shouldn’t be any indentation (see the reference documentation for the CircleCI 2.x configuration keys).

Also, in case you’re not already using it, the CircleCI CLI is a great tool to validate you config.yml.