Search code examples
amazon-web-servicesreact-nativeexpoaws-codebuildexpo-web

CodeBuild + ReactNative + Expo Web - This build image requires selecting at least one runtime version


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?


Solution

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