2

Trying to use CodeBuild for the first time, pulling data from CodeCommit. But I'm having issues with my buildspec. This is the code I have on it so far:

version: 0.2

phases:

    INSTALL:
        runtime-versions:
            nodejs: 10
        commands:
            - npm install


    PRE_BUILD:
      commands:
        - npm install --quiet --global expo-cli
        - >
          if [ -f yarn.lock ]; then
            yarn
          elif [ -f package-lock.json ] || [ -f npm-shrinkwrap.json ]; then
            npm ci
          else
            npm install
          fi
    BUILD:
      commands:
        - expo build:web

artifacts:
    baseDirectory: web-build
    files:
      - '**/*'
    name: 
        myname-$(date +%Y-%m-%d) 
cache:
    paths:
      - node_modules/**/*
      - $(npm root --global)/**/*

I have already added the runtime for nodejs 10, it had stopped to trigger this error, but now it kicked again. Does anyone know how to properly tweak it for React-Native web projects?

rdrgtec
  • 592
  • 10
  • 26

1 Answers1

2

I believe the phase names are case sensitive, so change them to install, pre_build and build.

Jason Wadsworth
  • 8,059
  • 19
  • 32
  • Perfect, thank you! I have copied from the log message... it is uppercase there, but indeed needs to be lowercase on the buildspec file!! – rdrgtec Jan 30 '20 at 17:47