Updating all Meteor packages to latest versions
Asked Answered
T

10

27

I'm developing a Meteor app that isn't yet in production, so I can afford to move quickly when adopting new package versions (useraccounts had a significant version bump a few hours after I'd integrated it, for instance.) This was what I thought meteor update was meant to accomplish. Yet when I run:

meteor update

from my project, I'm told that packages were updated but .meteor/versions remains unchanged.

I can upgrade the package by running meteor add someone:package@whatever, but this just shuffles the version dependency from .meteor/versions to .meteor/packages even though it seems to do the upgrade. I'm happy to lock versions down when I go to production, but it seems like in development I should be able to use the update command, especially as meteor list indicates that as a next step.

I've managed to upgrade all my packages by removing .meteor/versions and .meteor/local and running meteor update, but this seems messy.

I also found this issue but it was closed. Should it be reopened or should I open a new issue? I understand how semver works, but I think the issue is that Meteor isn't writing its constraint solver results to .meteor/versions so doesn't realize that package updates have been applied. Is that accurate or am I just misunderstanding something?

Tetreault answered 19/2, 2015 at 17:6 Comment(1)
Could you post up the complete output of meteor list?Cleodell
A
17

For the time being it looks like that you have 2 options for packages which have updates you wish to use:

  1. remove and add the package of concern via meteor remove provider:package_name and meteor add provider:package_name
  2. update packages with their specific version manually via meteor add provider:[email protected]

Meteor won't update packages unless you remove and add them #2500

Aixenprovence answered 21/2, 2015 at 8:15 Comment(1)
after meteor update package-xyz don't you have to do something to make it permanent across the next restart? Edit config?Mobilize
B
37

now u can simply do

meteor update --all-packages
Bluhm answered 14/9, 2016 at 22:29 Comment(0)
M
28

Expanding on previous answers, you can update all packages with this:

grep -ve '^#' .meteor/packages | xargs meteor update
Morissa answered 15/12, 2015 at 23:48 Comment(1)
this is the correct answer to the question posted. thank youBeverle
A
17

For the time being it looks like that you have 2 options for packages which have updates you wish to use:

  1. remove and add the package of concern via meteor remove provider:package_name and meteor add provider:package_name
  2. update packages with their specific version manually via meteor add provider:[email protected]

Meteor won't update packages unless you remove and add them #2500

Aixenprovence answered 21/2, 2015 at 8:15 Comment(1)
after meteor update package-xyz don't you have to do something to make it permanent across the next restart? Edit config?Mobilize
S
14

You can also use meteor update provider:package_name

Stiles answered 24/9, 2015 at 10:56 Comment(0)
D
13

Easiest way is to delete the contents of .meteor/versions and then save. Next time you run meteor it will update all packages to the latest version.

Devilfish answered 15/3, 2016 at 8:37 Comment(1)
This is the most effective and easiest way to do it as I find.Anastos
C
2

Just tiny addition to @Meteorpoly answer:

You can also edit package version in .meteor/versions file manually and meteor will pick it up on next/current run

Colwen answered 14/9, 2015 at 2:16 Comment(0)
M
2

From Meteor docs: meteor update --packages-only

This command will update all the packages which are not built locally, has an update available and is also compatible with the meteor version you are using.

Maomaoism answered 25/10, 2016 at 11:52 Comment(0)
W
0

It seems that now

meteor update

is enough to update all packages

Welterweight answered 20/2, 2017 at 22:4 Comment(0)
M
0

lets assume you wish to keep your meteor at your current release then issue

meteor --release foo    update --all-packages

where foo indicates your current meteor release ... you can identify your release by looking at file

cat .meteor/release

which for me has content of

[email protected]

so my current meteor release is 1.10.2 ... to leave alone my current meteor release yet upgrade all packages to match my release 1.10.2 then command is

meteor --release 1.10.2    update --all-packages

alternatively if you wish to fully upgrade to both latest meteor release AND that release's package upgrades then issue

meteor update --all-packages
Mania answered 2/8, 2022 at 15:29 Comment(0)
R
-1

I used packagecheck. It analyzed the project, showed me available updates and assisted the general update.

$ npm install -g packagecheck
$ packagecheck
Rooker answered 16/9, 2020 at 16:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.