Jump to content
Search Community

Can't login via npm login --registry=https://npm.greensock.com. bad username/password, access denied

BBaysinger
Moderator Tag

Go to solution Solved by GreenSock,

Recommended Posts

BBaysinger
Posted

I'm trying to npm install, and I'm getting some errors. It's telling me to log in, but it's rejecting my credentials. I think my username is right. It's BBaysinger, but it seems to accept bbaysinger. My site login password doesn't work, but I come to understand 'password' should be my token. That doesn't work either. Couldn't find a video covering this. Please help!
 

bbaysinger@macbookpro frontend % npm install
npm error code E403
npm error 403 403 Forbidden - GET https://npm.greensock.com/@gsap%2fshockingly - bad authorization header. Please login again
npm error 403 In most cases, you or one of your dependencies are requesting
npm error 403 a package version that is forbidden by your security policy, or
npm error 403 on a server you do not have access to.
npm error A complete log of this run can be found in: /Users/bbaysinger/.npm/_logs/2025-02-15T17_49_14_939Z-debug-0.log
bbaysinger@macbookpro frontend % npm login --registry=https://npm.greensock.com
npm notice Log in on https://npm.greensock.com/
Username: bbaysinger
Password: 

npm error code E409
npm error 409 Conflict - PUT https://npm.greensock.com/-/user/org.couchdb.user:bbaysinger/-rev/undefined - bad username/password, access denied
npm error A complete log of this run can be found in: /Users/bbaysinger/.npm/_logs/2025-02-15T17_49_46_030Z-debug-0.log

 

  • Solution
GreenSock
Posted

First of all, thanks for being a Club GSAP member, @BBaysinger 💚

 

You shouldn't need to enter any password for an NPM install at all. It sounds like maybe you didn't create the proper .npmrc file in your project directory. Please follow the directions from the installation page here: 

https://gsap.com/docs/v3/Installation?tab=npm&module=esm&method=private+registry&tier=club&club=true&require=false&trial=true

 

For example, you should have an .npmrc file that contains something like this: 

always-auth=true
//npm.greensock.com/:_authToken=[YOUR-TOKEN-HERE]
@gsap:registry=https://npm.greensock.com

(don't forget to paste your token in where [YOUR-TOKEN-HERE] is. And then the first time you install GSAP, you'd do it like this: 

npm install gsap@npm:@gsap/shockingly

("shockingly" may be different for others based on their membership level)

 

Also keep in mind that you don't need to install it this way at all - you could just log into your GSAP account and download the zip file. That contains a directory named "npm-install-this" with a gsap-bonus.tgz file in it. Just drop that into your project directory and run: 

npm install ./gsap-bonus.tgz

Those directions are here: 

https://gsap.com/docs/v3/Installation?tab=npm&module=esm&method=zip&tier=club&club=true&require=false&trial=true

 

That way, there are no logins whatsoever to deal with, no .npmrc file configuration, etc. 

 

I hope that clears things up!

  • Like 1
BBaysinger
Posted

Ok, you got it! I changed my .npmrc file, and it was incorrect. Thanks for the weekend reply!!!

  • Like 1
BBaysinger
Posted

Ok, I had it working, but now without any changes that should matter, it's asking me to log in again, and not accepting my credentials. It needs to work through command line so I know it will work on Netlify.
 

bbaysinger@macbookpro frontend % npm install gsap@npm:@gsap/shockingly
npm error code E403
npm error 403 403 Forbidden - GET https://npm.greensock.com/@gsap%2fshockingly - bad authorization header. Please login again
npm error 403 In most cases, you or one of your dependencies are requesting
npm error 403 a package version that is forbidden by your security policy, or
npm error 403 on a server you do not have access to.
npm error A complete log of this run can be found in: /Users/bbaysinger/.npm/_logs/2025-02-17T00_08_47_430Z-debug-0.log


I changed my token and updated it. My .npmrc looks like:
 

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


My .env looks like:
 

NETLIFY_AUTH_TOKEN=XXX_XXXXXXXXXXXXXXXXXXXXXXX945a1
GSAP_AUTH_TOKEN=XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXbd33


One part of my initial question wasn't answered. Is the login password my token?

BBaysinger
Posted

BTW, installing from .tgz didn't work.

bbaysinger@macbookpro frontend % npm install ./gsap-premium.tgz
npm warn tarball tarball data for file:gsap-premium.tgz (null) seems to be corrupted. Trying again.
npm warn tarball tarball data for file:gsap-premium.tgz (null) seems to be corrupted. Trying again.
npm error code ENOENT
npm error syscall open
npm error path /Users/bbaysinger/Work/Portfolio Site/portfolio-2024/frontend/gsap-premium.tgz
npm error errno -2
npm error enoent ENOENT: no such file or directory, open '/Users/bbaysinger/Work/Portfolio Site/portfolio-2024/frontend/gsap-premium.tgz'
npm error enoent This is related to npm not being able to find a file.
npm error enoent
npm error A complete log of this run can be found in: /Users/bbaysinger/.npm/_logs/2025-02-17T00_31_51_838Z-debug-0.log

But then I found the file nested in the download that appeared to be intended for this:  gsap-bonus.tgz. That file wasn't noted in the instructional video.

 

It's very interesting that I can push the .zip file up to the repo and have it build and deploy on Netlify. Mind blown. 🤯🔫  That's a temporary fix, but glad for the workaround. 

GreenSock
Posted
13 minutes ago, BBaysinger said:

BTW, installing from .tgz didn't work.

Did you rename the file yourself? In the download, it's gsap-bonus.tgz, not gsap-premium.tgz. It looks like you just mistyped the prompt. 

 

30 minutes ago, BBaysinger said:

One part of my initial question wasn't answered. Is the login password my token?

There is no password. You shouldn't ever need to "login" anywhere. The authentication just uses your token from the .npmrc file, period. 

 

As for Netlify, you followed the instructions here, right?: https://gsap.com/docs/v3/Installation/guides/Netlify

BBaysinger
Posted

I didn't rename it, it was the .tgz file nested within the download that gets installed. I didn't know it was a different one, and that wasn't noted in the video. I found it because it was in a folder that was intuitively named npm-install-this.

It's NPM that requests the login. I'll just ignore that. I did follow the instructions and had it working previously and haven't changed what worked before.

BTW, whether I use a .env variable, or have the token directly in my .npmrc as per the tutorial doesn't matter. It doesn't work either way. I restarted. I've tried everything I can think of so far.

GreenSock
Posted
7 minutes ago, BBaysinger said:

I didn't rename it, it was the .tgz file nested within the download that gets installed. I didn't know it was a different one, and that wasn't noted in the video. I found it because it was in a folder that was intuitively named npm-install-this.

OH! I bet you downloaded the zip from the site which [for you] is indeed named gsap-premium.zip but you need to unzip that file and INSIDE that, you'll find an "npm-install-this" folder containing a gsap-bonus.tgz file. THAT is the thing you drop into your project directory and then run npm install ./gsap-bonus.tgz

 

I bet you accidentally tried to install the entire gsap-premium.zip file that you downloaded instead of the gsap-bonus.tgz file. 🤷‍♂️

 

If everything worked for you previously, there must be something in your setup that changed on your end. I'm not sure what that could be. I really wish I could help more. Perhaps @Rodrigo will have an idea. Are you saying it won't work locally or are you saying it just won't work on Netlify? 

BBaysinger
Posted

Yep, that was it!

 

I had it working after your first reply yesterday both on local and Netlify. Then it stopped working again last night on local, and I haven't been able to figure it out. (But I'm able to keep developing with the workaround.)

Posted

Hi,

 

You mention that locally but works when you deploy to netlify? That's odd.

 

Maybe you can try deleting the package-lock.json file and then push again to your repo and see how the deployment flow works. Also what particular framework are you using for this project? I ask because is a bit odd to use .env files this way. As far as I know .env files are used at runtime but the package manager (NPM in this case) has no access to them. If memory serves me well this could work with previous versions of NextJS, but IDK if that works now, that's why for installing packages the way is using a .npmrc file. The great thing is that you only need to add your token in the .npmrc file once, then you can replace it with the environmental variable you have in Netlify and be done with it.

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