Jump to content
Search Community

How to change npm token to ci/cd

Solbeg test
Moderator Tag

Recommended Posts

Hi,

 

As far as I can tell every hosting provider that offers a CI/CD pipeline integration (Netlify, Vercel, AWS, Digital Ocean, etc) offers the possibility of setting environmental variables.

 

The most common approach is to create a .npmrc file with this in it:

always-auth=true
@gsap:registry=https://npm.greensock.com
//npm.greensock.com/:_authToken=${NPM_TOKEN}

Then in your hosting service you create the environmental variable NPM_TOKEN and add the token you created in your Account's Dashboard.

 

Take a look at these articles:

https://blog.privjs.com/article/how-to-install-club-greensock-packages-on-digitalocean-aws-etc

https://blog.privjs.com/article/how-to-install-club-greensock-packages-on-netlify

https://blog.privjs.com/article/how-to-install-club-greensock-packages-on-vercel

 

If you keep having issues, please be more specific about what exactly you're trying to do and any errors you could be getting in order to get a better idea of what could be the issue.

 

Hopefully this helps.

Happy Tweening!

  • Like 1
Link to comment
Share on other sites

The same token works both locally and on ci/cd. I had the same issue on Vercel after following the steps mentioned on the Gsap dashboard and setting the Vercel environment variable. I then saw that the default install command was set as "yarn install" in my Vercel project, while I was using npm install locally. I overrode the default build command to "npm install" in Vercel, and it started deploying successfully.

  • Thanks 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...