#✅ - npmrc token not working using env variables in next js

3 messages · Page 1 of 1 (latest)

opal obsidian
remote latch
#

👋 here's one way to pass the env vars to .npmrc at build time:

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - echo "//registry.npmjs.org/:_authToken=${NPM_CONFIG_AUTH_TOKEN}" > .npmrc
        - echo "//registry.npmjs.org/:_authToken=${NEXT_PUBLIC_NPM_CONFIG_AUTH_TOKEN}" > .npmrc
    build:
      commands:
        - npm run build
dense beaconBOT
#

✅ - npmrc token not working using env variables in next js