Next.js Discord

Discord Forum

How to include .env file while npm install

Unanswered
Fila Brasileiro posted this in #help-forum
Open in Discord
Fila BrasileiroOP
I've created private npm package hosted on github packages. In order to authorize I needed to add npmrc. file:
engine-strict=true

@myOrg:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=github_PAT

And it works fine, github_PAT was pasted inline. Now I want to host my app on vercel, so I need to put my github_PAT to .env file. And create new sercet in vercel settings to make it work. But putting this token in my .env and replacing file npmrc. with:
engine-strict=true

@myOrg:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=${GITHUB_PERSONAL_ACCESS_TOKEN}

doesnt work even locally. I still get info after npm install, that authorization failed. What Im missing here?

0 Replies