Jump to content
Search Community

npm ERR! code E403 // Next 14

dianthe studio test
Moderator Tag

Go to solution Solved by Rodrigo,

Recommended Posts

I have just purchased a Club GSAP subscription, and I've tried every suggestion & watched every video & I'm still getting this error. Please advise ((:

my .npmrc file is at the root of my project & looks like this:

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

here is a screenshot of the error message:
image.thumb.png.274fa2ae6bd167c2d348b07bcca668a2.png

Link to comment
Share on other sites

  • Solution

Hi @dianthe studio and welcome to the GSAP Forums!

 

Thanks for being a Club GSAP member and supporting GSAP!

 

Be aware that when you first install GSAP locally in your project your .npmrc file should have your token. Just be sure to not push that file to a public repo just yet. The environmental variable is after the installation in your local machine is successful and before pushing the changes to your repo.

 

The flow should be like this:

  1. Create your Next project locally
  2. Create your .npmrc file, that should look like this (at this point don't push any files to a public repo yet):
    always-auth=true
    //npm.greensock.com/:_authToken=your-token-here
    @gsap:registry=https://npm.greensock.com
  3. Install GSAP:
    npm install gsap@npm:@gsap/shockingly
  4. Install the @gsap/react package so you can use our brand new useGSAP hook:
    npm install -s @gsap/react

     

  5. Change your .npmrc file to this:
    always-auth=true
    //npm.greensock.com/:_authToken=${GSAP_TOKEN}
    @gsap:registry=https://npm.greensock.com

    At this point is safe to push files and changes to a public repo since the token is no longer in the .npmrc file.

  6. Go to your deployment provider (Netlify/Vercel/etc.) and create an environmental variable in your project called GSAP_TOKEN and add your token in it.

Now you should be able to deploy and install everything without any issues.

 

Let us know how this works.

Happy Tweening!

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...