amplify-hosting icon indicating copy to clipboard operation
amplify-hosting copied to clipboard

Lerna Monorepo - Can't install private github package

Open dylan-westbury opened this issue 3 years ago • 0 comments

Before opening, please confirm:

App Id

d4qjx8bzy0kti

Region

us-east-1

Amplify Hosting feature

Build settings, Custom builds, Monorepo

Describe the bug

Private github package is not found for Lerna monorepo during build. Although it installs based on custom build settings.

Expected behavior

Private github package should be found after successful install

Reproduction steps

  1. Set up amplify hosting for react app as monorepo (Lerna)
  2. Update build settings to create .npmrc and install package
  3. Run build

Build Settings

version: 1
applications:
  - backend:
      phases:
        build:
          commands:
            - '# Execute Amplify CLI with the helper script'
            - amplifyPush --simple
    frontend:
      phases:
        preBuild:
          commands:
            - yarn install --frozen-lockfile
            - echo -e "always-auth=true\n@apptractive:registry=https://npm.pkg.github.com/\n//npm.pkg.github.com/:_authToken=$NPM_AUTH_TOKEN" > .npmrc
            - yarn add @apptractive/shared
            - yarn add @apptractive/design-system-web
        build:
          commands:
            - yarn run build
      artifacts:
        baseDirectory: build
        files:
          - '**/*'
      cache:
        paths:
          - node_modules/**/*
    appRoot: packages/backoffice-app

Additional information

Also tried for another react frontend

AppId d3cy3g6nh4jbkc

Uploading Screen Shot 2022-08-11 at 8.33.38 pm.png…

dylan-westbury avatar Aug 11 '22 10:08 dylan-westbury