Jump to content
GreenSock

BrianCross

NPM Private Registry 403 Error

Recommended Posts

Hi everyone, I'm getting the following error while trying to install from the private registry:

$ npm install gsap@npm:@gsap/shockingly

npm ERR! code E403
npm ERR! 403 403 Forbidden - GET https://npm.greensock.com/gsap - bad authorization header. Please login again
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.

This is a Next JS project that I'm starting. I just worked on another Next JS project and had no issues installing from the private registry. I've searched a few threads and all suggested solutions result in the same error. I've double checked the authorization token and I actually copied the .npmrc file and .env.local that contains the actual token from the previous project.

Link to comment
Share on other sites

I wonder if you're running into that ongoing problem with NPM v7. A bug report has already been filed and we're awaiting their response. Until then the only workaround we have found so far is running two install commands while on npm v7:

npm install @gsap/shockingly
npm install gsap@npm:@gsap/shockingly

The reason why we need two install commands is because the first command inserts the correct package into the npm cache. So the next command will be able to retrieve the package directly from the npm cache.

 

Another thread that might be helpful (or not): 

 

  • Like 1
Link to comment
Share on other sites

Hi Jack, yeah I saw a post regarding the issue with NPM 7. I had tried your suggestion above but it still threw the 403 error. I'll check out that other thread as well. Thanks!

Link to comment
Share on other sites

On 5/13/2021 at 11:11 AM, BrianCross said:

Hi everyone, I'm getting the following error while trying to install from the private registry:



$ npm install gsap@npm:@gsap/shockingly

npm ERR! code E403
npm ERR! 403 403 Forbidden - GET https://npm.greensock.com/gsap - bad authorization header. Please login again
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy, or
npm ERR! 403 on a server you do not have access to.

This is a Next JS project that I'm starting. I just worked on another Next JS project and had no issues installing from the private registry. I've searched a few threads and all suggested solutions result in the same error. I've double checked the authorization token and I actually copied the .npmrc file and .env.local that contains the actual token from the previous project.

 

Hi @BrianCross , do u mind sharing on how to configure the token in .env and also reference them from .npmrc? What i tried doesn't seems to work.

Link to comment
Share on other sites

Looks like your token is invalid. You might need to re-check the token added by you. Type these commands to reset the token:

 

$ npm config set @gsap:registry https://npm.greensock.com/
$ npm config set //npm.greensock.com/:_authToken <your-auth-token>
$ npm install @gsap/business
$ npm install gsap@npm:@gsap/business

 

This should solve the issue

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