【问题标题】:How can I completely uninstall and then reinstall Meteor.js?如何完全卸载然后重新安装 Meteor.js?
【发布时间】:2014-09-01 10:39:20
【问题描述】:

我的应用程序无缘无故开始崩溃。我回滚到我知道有效的版本,但它仍然崩溃。我从 github 克隆了一个我绝对知道可以工作的版本,因为我已经研究了一个星期。它不会开始。一切都是“未定义的”——流星、用户界面、路由器、模板等。我没有时间做这个。如何完全卸载 Meteor 并从头开始重新安装?

关于奖励积分:为什么会发生这种情况以及如何防止再次发生?

【问题讨论】:

  • 您是否忘记签入您的.meteor 目录?你跑mrt install了吗?
  • rm -rf ~/.meteor ~/.meteorite
  • 卸载 Meteor 可能无济于事。如果在加载过程中出现错误,其他一切都将是未定义的。看看是什么引发了第一个错误。
  • @Jon Cowell,你有没有想过这个问题?我也遇到了同样的问题!

标签: meteor


【解决方案1】:

如果您在 2021 年寻找答案:

meteor-installer uninstall

然后

meteor-installer install

【讨论】:

    【解决方案2】:

    TL;DR

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

    解释

    查看https://install.meteor.com/可以看到如下代码:

    # 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
    

    但不幸的是,这并没有删除 meteor 脚本,因此需要手动删除它。

    【讨论】:

      【解决方案3】:

      卸载 Linux 和 OS X 用户

      打开终端并运行以下命令-

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


      安装 Meteor

      打开终端并运行以下命令-

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

      【讨论】:

        【解决方案4】:

        如果您在 Windows 操作系统上寻找 2017/2018 年的答案:

        choco uninstall meteor
        

        然后

        choco install meteor
        

        【讨论】:

          【解决方案5】:

          我认为最简单的是

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

          【讨论】:

          • 我同意,因为它会删除所有以前的流星安装。
          【解决方案6】:

          让我们从删除开始,然后我们将继续进行重新安装。

          1. 如果您曾经安装过 Meteorite,请卸载并删除它:

            sudo mrt uninstall
            sudo mrt uninstall --system
            rm -rf ~/.meteorite
            
          2. 然后删除 Meteor:

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

          现在从头开始:

          1. 必要时修复权限:

            sudo chown -R $(whoami) ~/.npm
            
          2. 重新安装 Meteor:

            curl https://install.meteor.com/ | sh
            
          3. 接下来检查您的项目是否包含所有正确的包:

            cd /path/to/your/project
            meteor update
            
          4. 如果您的项目仍然无法编译,您可以重置它(警告:删除数据库):

            cd /path/to/your/project
            meteor reset
            
          5. 还是没有运气?重新创建 Meteor 项目(警告:删除数据库和项目对您已安装的包的内存):

            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
            

            (并反复运行 meteor add *packagename* 以重新安装您正在使用的每个软件包)

          【讨论】:

          • 优秀。您是否有机会进行编辑以准确解释每个步骤发生的情况,以及为什么有必要? Fibers 真的必须在全球范围内安装吗?
          • 还有:'install' is not a Meteor command. See 'meteor --help'.
          • 抱歉,我换了它们。这是meteor updatemrt install。已更正。
          • 关于您的第一条评论,我已经解释了每个步骤中发生了什么;有没有特别令人困惑的步骤?重新安装 Node.js 和 Fibers 很可能是不必要的步骤,但为了完整性,以防万一您的问题源于那里;在项目的node_modules 文件夹损坏的情况下,全局安装 Fibers 似乎会有所帮助。见stackoverflow.com/questions/15851923/…
          • 这个答案救了我两次。谢谢。
          【解决方案7】:

          这里还有别的东西,我读了一个文件, 位于 /usr/local/bin/ 顶部的 cmets 中命名为 meteor 它是这样写的:

              #!/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/).
          

          这是卸载流星的行:

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

          瞧!仓库在哪里!你们中的一些人可能认为这个仓库是项目中的 .meteor 文件夹,但事实并非如此! 下面2-3行写着:

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

          这就是仓库所在的地方!

          重置 Meteor 项目由“meteor reset”完成,只会重置您的项目包。

          附:这是流星 v1+

          【讨论】:

            【解决方案8】:

            我尝试了所有这些,但都没有成功。

            然后我在命令行中运行meteor --verbose,它似乎已经解决了问题!快速meteor reset,现在一切都恢复正常了!

            【讨论】:

            • Meteor --verbose 有助于调试很多
            猜你喜欢
            • 2012-06-26
            • 1970-01-01
            • 2018-07-31
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多