Search code examples
npmmeteorinstallationversionupgrade

Meteor global version is different than project's


I've created a meteor project and noticed its meteor version was really behind the global meteor installation version:

npm global meteor installed version

If I check meteor version outside of a meteor project, it returns an older version: older meteor version

And this older version matches the meteor version in this project I've just created.

After some googling, I learned there was this directory ~/.meteor and apparently it contained and older meteor version: .meteor packages dir

Then, I renamed this dir to meteorBKP and ran meteor --version expecting that now the meteor command would point to the npm global package. What happened, though, is that the directory was created again, but this time containing a much newer version.

meteor version after renaming dir

So, apparently, I have two meteor versions installed in my computer. Is it expected? How can I remove that unwanted installation and use only the npm global package?

If you need further info to help, I'll gladly provide it.

Thanks in advance!


Solution

  • Actually, you don't have two Meteor versions in your machine. Right now, you have only Meteor 2.5.3 (the latest version).

    Version 2.5.4 that you see from npm is the version of the Meteor installer. This npm package is not Meteor itself, it is just an installer. You can see and compare these versions here (https://www.npmjs.com/package/meteor).

    Besides that, each Meteor project may have different versions. If you create a project right now (meteor create myproject), by default it will use Meteor 2.5.3 (the newer version you have locally) but that project you mention you have created before with Meteor 1.8.1 will still use version 1.8.1. You can check which Meteor version a project is using by checking yourprojectdirectory/.meteor/release.

    Also, you have the option to create a new project with an older version by just passing a --release option (meteor create myproject --release 2.5.1).

    I hope it is more clear now.