Jump to content
GreenSock

Friebel

[solved] Gsap is not updating with 'npm update' to 3.2.2

Recommended Posts

I'm currently having gsap 3.2.0 installed and the latest version on npm now is 3.2.2.

But even though the package json says '^3.2.0' behind the 'gsap' dependency, with 'npm update' or 'npm update gsap' the gsap package doesn't update to the latest version. I even completely removed the full node_modules folder and did a fresh 'npm install' with the exising package.json just to be sure and tried 'npm update' and 'npm update gsap' afterwards, but it still doesn't update gsap from 3.2.0 to the latest version.

 

It seems like something is off on npm/gsap. Which is strange to me, as npm/gsap (https://www.npmjs.com/package/gsap) is indeed telling the latest version is 3.2.2.

 

The only way that is working now, is re-installing gsap with 'npm install gsap@3', but I would expect npm update to work as well, as it is not a major version change from 3.2.0 to 3.2.2. Or am I mistaken?

 

"dependencies": {
    ...
	"gsap": "^3.2.0"
    ...
}

 

Link to comment
Share on other sites

Worked fine for me...

 

image.thumb.png.501025cc8d08e81e5f4e1aeb31e948c9.png

 

Not sure why you are having problems. Maybe you need to clear your npm cache? Or try restarting your development environment.

 

  • Like 1
Link to comment
Share on other sites

2 minutes ago, OSUblake said:

Worked fine for me...

Just to be sure: you really did 'npm update' (so not npm install gsap@3)?

 

BTW I never had this problem before. Not with gsap, neither with other packages. Other packages (and gsap until now) are upgrading with 'update' perfectly fine, also on this project)

Link to comment
Share on other sites

Oh, I see. A caret, ^, is for major versions

 

For minor versions, you need to use a tilde ~.

 

"gsap": "~3.2.0"

 

Link to comment
Share on other sites

13 minutes ago, Friebel said:

Just to be sure: you really did 'npm update' (so not npm install gsap@3)?

 

Forgot to mention this, but yes, I did npm update.

Link to comment
Share on other sites

1 minute ago, OSUblake said:

A caret, ^, is for major versions

For minor versions, you need to use a tilde ~.

 


"gsap": "~3.2.0"

 

No no no. That's not true.

Link to comment
Share on other sites

After one time using 'npm install gsap@3', which did upgrade gsap from 3.2.0 to 3.2.2, now the 'npm update' is working again.

So because I was working around the 'npm update' not working as described above, by using 'install' instead of 'update' to go from 3.2.0 to 3.2.2, now suddenly the update is working again ( @OSUblake : still just with a regular caret)

So now I was on gsap 3.2.2 (after the 'hard' install of 3.2.2) and then go back to 3.2.0 with 'npm install gsap@3.2.0' and after that try 'npm update gsap' it does work. So the hard install fixed the issue.

 

So not sure what this was. I never seen this problem before on any of my projects with any of the packages I use. So if nothing is changed on npm/gsap this must have been some cache thing, but it remains odd to me as I even did a complete clean npm install in the end after completely removing the node_packages folder. And that didn't help.

 

Well, whatever does the trick.

 

 

  • Like 3
Link to comment
Share on other sites

@OSUblake @ZachSaucier

 

 

Ah my bad, this was probably a problem with the package-lock.json file. I had it commited to git and pulled the project on another system without running an npm install there, so the lock-file wasn't in sync with the actual installed modules.

 

My bad, I should not check in lock-files. Or run an npm install on the new system to update the node-modules after pulling from git.

  • Like 3
Link to comment
Share on other sites

1 hour ago, Friebel said:

No no no. That's not true.

 

What part isn't true?

 

image.thumb.png.e9a4a8ebccc932352478ee58cc650a09.png

 

 

24 minutes ago, Friebel said:

My bad, I should not check in lock-files.

 

I think checking in lock-files is a good practice for the most part. For lock files, instead of doing npm install or npm update, you should do npm ci. But that wouldn't do the upgrade from 3.2.0 to 3.2.2 like you wanted.

 

Regardless, I'm glad you figured the problem out. I'm just posting this response for clarity to future readers.

 

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