Skip to content

Deploying on AWS Amplify, NPM Error "authentication token not provided" #398

Discussion options

You must be logged in to vote

Yes sure, I will add it as an answer here.

The amplify.yml file:

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - echo "" >> .npmrc
        - echo "@capawesome-team:registry=https://npm.registry.capawesome.io" >> .npmrc
        - echo "//npm.registry.capawesome.io/:_authToken=${CAPAWESOME_TOKEN}" >> .npmrc
        - npm ci
    build:
      commands:
        - npm run build
  artifacts:
    baseDirectory: dist
    files:
      - '**/*'
  cache:
    paths:
      - .npm/**/*

I am not certain that ' echo "" >> .npmrc' is required, but it does no harm and I had a hunch it intermittently wasn't being cleared properly between builds.

I add the ${CAPAWESOME_TOKEN} to the env…

Replies: 4 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@robingenz
Comment options

@kirkHawksworth
Comment options

@robingenz
Comment options

Comment options

You must be logged in to vote
1 reply
@robingenz
Comment options

Comment options

You must be logged in to vote
1 reply
@robingenz
Comment options

Answer selected by kirkHawksworth
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants