Skip to content

Private registry works with npm but not with yarn when deploying on vercel #5418

Locked Answered by allan-almeida
agcty asked this question in General
Discussion options

You must be logged in to vote

For new versions of Yarn, (I am using 2.4.0), I was able to successfully deploy to Vercel by adding the following to my .yarnrc.yml file:

npmScopes:
  YOUR_SCOPE:
    npmRegistryServer: 'https://npm.pkg.github.com'
    npmAlwaysAuth: true
    npmAuthToken: ${GITHUB_PACKAGE_TOKEN}

as per https://yarnpkg.com/configuration/yarnrc#npmScopes.

I also added GITHUB_PACKAGE_TOKEN as an environment variable to my builds in Vercel.

Replies: 2 comments 4 replies

Comment options

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

@amyegan
Comment options

@nathanielpomianowski
Comment options

Comment options

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

Answer selected by amyegan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants