Private registry works with npm but not with yarn when deploying on vercel #5418
-
We're using yarn to build the project and have a private github npm registry to host some of our packages. Locally, both yarn and npm work with the same .npmrc file. Local npm version: 6.14.8 Vercel seems to deploy with yarn 1.22.4, not sure if this is an issue. Has anyone managed to deploy a project both yarn and a private registry? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
So after reaching out to vercel support, they showed me this issue: yarnpkg/yarn#3093 You have to make your .npmrc look exactly like this: always-auth=true You somehow need always-auth=true and both npm.pkg.github.com lines |
Beta Was this translation helpful? Give feedback.
-
For new versions of Yarn, (I am using
as per https://yarnpkg.com/configuration/yarnrc#npmScopes. I also added |
Beta Was this translation helpful? Give feedback.
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:as per https://yarnpkg.com/configuration/yarnrc#npmScopes.
I also added
GITHUB_PACKAGE_TOKEN
as an environment variable to my builds in Vercel.