Jump to content
Search Community

Club Greensock token 403 error

Sgt. Red Pepper test
Moderator Tag

Recommended Posts

Hello,

 

Our organization started using Club Greensock packages a little while ago, and we have been having trouble with the installation from the private NPM registry.

 

We use yarn instead of npm, so when Club Greensock was first installed, these yarn instructions were followed, with the only difference being that we hid our token: https://blog.privjs.com/article/how-to-install-club-greensock-packages-on-digitalocean-aws-etc

 

Locally, our auth token is read from our shell profiles, and in Bitbucket the auth token is stored as an environment variable.  

 

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

 

Everything came together nicely and was working properly; however, today we have run into a unique issue. 

 

Our club packages are working with no issue on our local servers, but the installation step in our Bitbucket CI/CD pipeline is failing. 

 

Our pipelines were running successfully 2 hours ago, but now they are failing on the GSAP installation step, giving us a 403 error. 

 

We are able to log our token to the Bitbucket console, confirming that it is being read, but the NPM authentication is failing. 

 

Is there an issue with the private NPM registry?  

 

There seem to have been quite a few issues in the past with Club GSAP and yarn installations, have any of the troubleshooting steps been consolidated into more straightforward, official instructions?

 

Are there any recommendations for the best practices when it comes to using Club GSAP packages as part of larger, team based projects with CI/CD workflows?

 

Any help or insight would be appreciated as we seem to be taking two steps forward, one step back with our incorporation of the club packages. 

 

Thank you. 

 

Link to comment
Share on other sites

Hello @Sgt. Red Pepper

403 error is returned when the yarn or npm cli doesn't get the GSAP token value. 

Usually yarn cli reads the .npmrc file in the project, but some versions require a .yarnrc file. It would be helpful to know which version of yarn you are using.

Also, can you make sure whether the env variable is added to the container/vpc? Please note that the variable needs to be exposed to the machine where the `yarn install` command is run. (Many projects don't expose env variables to docker instances hence 403 errors)

Let me know if this helps

  • Like 2
Link to comment
Share on other sites

I tried replicating it with yarn version 1.0. It is strange that yarn is not reading the env variables.

Since you are using yarn, it could help if you rename `.npmrc` to `.yarnrc`. 

If this still doesn't help, then running the commands on the machine should configure the values:
```

$ yarn config set @gsap:registry https://npm.greensock.com

$ yarn config set //npm.greensock.com/:_authToken <token here>

```

  • Like 3
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...