How can I completely uninstall and then reinstall Meteor.js?
Asked Answered
C

8

34

My app started crashing for absolutely no reason. I rolled back to a version I knew worked, but it is still crashing. I cloned a version from github that I absolutely know was working because I've been working on it for a week. It won't start. Everything is 'undefined' -- Meteor, UI, Router, Template, etc. I don't have time for this. How can I completely uninstall Meteor and reinstall it from scratch?

For bonus points: why did this happen and how can I prevent it from happening again?

Chirp answered 10/7, 2014 at 21:55 Comment(4)
Did you forget to check in your .meteor directory? Did you run mrt install?Cenacle
rm -rf ~/.meteor ~/.meteoriteIrresoluble
Uninstalling Meteor probably won't help. If there is an error during the loading process, everything else will be undefined. Just look at what is throwing the first error.Thorne
@Jon Cowell, did you ever figure this out? I'm having the same problem!Wrier
M
71

Let’s start with the deletions, then we’ll move on to the reinstallations.

  1. If you ever installed Meteorite, uninstall and delete it:

    sudo mrt uninstall
    sudo mrt uninstall --system
    rm -rf ~/.meteorite
    
  2. Then delete Meteor:

    sudo rm /usr/local/bin/meteor
    rm -rf ~/.meteor
    

Now start over at the beginning:

  1. Repair permissions if necessary:

    sudo chown -R $(whoami) ~/.npm
    
  2. Reinstall Meteor:

    curl https://install.meteor.com/ | sh
    
  3. Next check that your project has all its proper packages:

    cd /path/to/your/project
    meteor update
    
  4. If your project still won’t compile, you can reset it (warning: deletes database):

    cd /path/to/your/project
    meteor reset
    
  5. Still no luck? Recreate the Meteor project (warning: deletes database and the project’s memory of what packages you’ve installed):

    cd /path/to/your/project
    rm -rf ./.meteor
    cd ..
    meteor create project-new
    rm ./project-new/project-new.*
    mv ./project/* ./project-new/
    cd ./project-new
    

    (and run meteor add *packagename* over and over to reinstall each package you were using)

Mesenchyme answered 11/7, 2014 at 1:45 Comment(9)
Excellent. Any chance you could edit to explain exactly what is happening at each step, and why it is necessary? Does Fibers really have to be installed globally?Chirp
Also: 'install' is not a Meteor command. See 'meteor --help'.Chirp
Sorry, I swapped them. It's meteor update and mrt install. Corrected.Mesenchyme
Re your first comment, I already did explain what was happening in each step; are there any steps in particular that are confusing? Reinstalling Node.js and Fibers are very likely unnecessary steps, but are included for completeness just in case your issue stems from there; and installing Fibers globally seems to help in the case of corrupted projects’ node_modules folders. See #15852423Mesenchyme
Why have you written npm install [email protected] -g instead of npm install -g fibers? Is the version important?Molluscoid
It was when I wrote that years ago, but it probably isn't now. Also I would change the "install node" step to "install n via homebrew: brew install n and then install the version of Node that Meteor supports: n 0.10.39 or whatever they're atMesenchyme
Update: Meteor installs its own version of Node that it keeps separate from whatever version you have installed globally (if you have one at all). So disregard the suggestion to use n to set your global Node to match Meteor's version. (I still recommend n, but it's irrelevant to Meteor.)Mesenchyme
This is the old way. See below for the new way.Biarritz
sudo rm -rf ~/.meteorGet
S
16

I think the easiest is

curl https://install.meteor.com/ | sh
Siblee answered 5/2, 2017 at 0:56 Comment(1)
I agree cause it removes all previous meteor installations.Graphology
O
8

If you are searching for answer in 2017/2018 on Windows Operating Systems:

choco uninstall meteor

Then

choco install meteor
Orsay answered 18/12, 2017 at 12:46 Comment(0)
W
3

I tried all of this and none of it worked.

Then I ran meteor --verbose in the command line and it seems to have sorted out the kinks! A quick meteor reset and everything is working again now!

Wrier answered 22/11, 2014 at 17:36 Comment(1)
Meteor --verbose helps debuugging a lotWende
R
2

There's something else here too, I read a file, located in /usr/local/bin/ named meteor in the comments on the top it was written:

    #!/bin/bash

# This is the script that we install somewhere in your $PATH (as "meteor")
# when you run
#   $ curl https://install.meteor.com/ | sh
# It's the only file that we install globally on your system; each user of
# Meteor gets their own personal package and tools repository, called the
# warehouse (or, for 0.9.0 and newer, the "tropohouse"), in ~/.meteor/. This
# means that a user can share packages among multiple apps and automatically
# update to new releases without having to have permissions to write them to
# anywhere global.
#
# All this script does is exec ~/.meteor/meteor. But what if you don't have it
# yet? In that case, it downloads a "bootstrap tarball", which contains the
# latest version of the Meteor tools, and plops it down at ~/.meteor. In fact,
# once you've run this once, you don't even really need this script: you can put
# ~/.meteor/ into your PATH, or a symlink to ~/.meteor/meteor into some other
# PATH directory. No special permissions needed!
#
# To uninstall Meteor from your system, just delete this shell script, and
# delete your warehouse (~/.meteor/).

Here's the line to uninstall meteor :

# To uninstall Meteor from your system, just delete this shell script, and
# delete your warehouse (~/.meteor/).

And voila! where's the warehouse! some of you might think this warehouse as the .meteor folder in the projects, but it's not! 2-3 lines below it is written:

METEOR_WAREHOUSE_DIR="${METEOR_WAREHOUSE_DIR:-$HOME/.meteor}"

that's where the warehouse is!

Reseting a Meteor Project is done by "meteor reset" would only reset your project packages.

P.S. This is for meteor v1+

Regicide answered 26/2, 2015 at 8:58 Comment(0)
M
2

If you are searching for an answer in 2021:

meteor-installer uninstall

then

meteor-installer install
Muliebrity answered 18/10, 2021 at 5:9 Comment(0)
C
1

Uninstalling Meteor for Linux and OS X users

Open up terminal and run the following command-

1. sudo rm /usr/local/bin/meteor
2. rm -rf ~/.meteor


Installing Meteor

Open up terminal and run the following command-

1. curl https://install.meteor.com/ | sh
Counterpart answered 3/12, 2018 at 2:54 Comment(0)
A
0

TL;DR

rm -rf "$HOME/.meteor"
rc=$(which meteor); rm $rc

Explanation:

When you look at the https://install.meteor.com/ you can see the following code:

# If you already have a tropohouse/warehouse, we do a clean install here:
if [ -e "$HOME/.meteor" ]; then
  echo "Removing your existing Meteor installation."
  rm -rf "$HOME/.meteor"
fi

but this, unfortunately, does not remove the meteor script, hence the need to remove it manually.

Arlinearlington answered 2/6, 2021 at 17:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.