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?

tadasajon
  • 14,276
  • 29
  • 92
  • 144

8 Answers8

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)

Geoffrey Booth
  • 7,168
  • 5
  • 35
  • 42
  • 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? – tadasajon Jul 11 '14 at 13:15
  • Also: `'install' is not a Meteor command. See 'meteor --help'.` – tadasajon Jul 11 '14 at 13:21
  • 2
    Sorry, I swapped them. It's `meteor update` and `mrt install`. Corrected. – Geoffrey Booth Jul 11 '14 at 17:29
  • 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 http://stackoverflow.com/questions/15851923/cant-install-update-or-run-meteor-after-0-6-release/16047056#16047056 – Geoffrey Booth Jul 11 '14 at 17:35
  • Why have you written `npm install fibers@1.0.1 -g` instead of `npm install -g fibers`? Is the version important? – Enrique Moreno Tent Jan 12 '16 at 16:20
  • 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 at – Geoffrey Booth Jan 12 '16 at 16:30
  • 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.) – Geoffrey Booth Feb 29 '16 at 23:32
  • This is the old way. See below for the new way. – Michael Cole May 07 '16 at 13:26
  • 2
    This answer has saved me twice. Thanks. – Squirrl Jul 01 '16 at 21:52
  • sudo rm -rf ~/.meteor – Viktor Bogutskii Nov 17 '16 at 18:53
16

I think the easiest is

curl https://install.meteor.com/ | sh
8

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

choco uninstall meteor

Then

choco install meteor
R13e
  • 1,026
  • 7
  • 12
ProllyGeek
  • 15,517
  • 9
  • 53
  • 72
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!

iteles
  • 861
  • 1
  • 7
  • 15
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+

Hossein
  • 525
  • 3
  • 13
2

If you are searching for an answer in 2021:

meteor-installer uninstall

then

meteor-installer install
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
Sahil Rajput
  • 135
  • 1
  • 5
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.

iku
  • 1,007
  • 2
  • 10
  • 23