【问题标题】:Trouble installing Meteor on Ubuntu在 Ubuntu 上安装 Meteor 时遇到问题
【发布时间】:2021-08-14 22:17:10
【问题描述】:

我看到很多人在我之前在 Ubuntu 上安装 Meteor 时遇到了问题,但我还没有看到我在这里遇到的特定错误,所以我正在发一个新帖子。 当我执行时:

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

我明白了:

Warning: Failed to create the file /home/ubuntu/.meteor-tarball-tmp:          
Warning: Permission denied
                                                                           
0.0%curl: (23) Failure writing output to destination

如果有人知道如何解决这个问题,请告诉我

【问题讨论】:

  • 你试过sudo curl https://install.meteor.com/ | sh
  • 您的主目录(假设您是用户ubuntu)似乎不属于您。试试sudo chown -R ubuntu:ubuntu /home/ubuntu,然后再试一次。

标签: ubuntu meteor


【解决方案1】:

您的主目录(假设您是用户ubuntu)似乎不归您所有。试试sudo chown -R ubuntu:ubuntu /home/ubuntu,然后再试一次。

【讨论】:

    【解决方案2】:

    我刚刚在运行的时候遇到了同样的错误……

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

    ... 在新安装的 Ubuntu 20.04 系统上。在尝试了一些更简单的方法(包括 Minh Nguyen 和 Christian Fritz 建议的方法)但都失败后,我最终选择了以下手动安装过程。

    1. 我在浏览器中访问了https://install.meteor.com/,并将安装脚本复制并粘贴到我的文本编辑器中。

    2. 我将文件保存为meteor-install.sh

    3. 我从终端以调试模式运行脚本:bash -x ./meteor-install.sh

    4. 在终端窗口的输出中,我找到了以下几行:

    + curl --progress-bar --fail --continue-at - https://s3.amazonaws.com/com.meteor.static/packages-bootstrap/2.3.4/meteor-bootstrap-os.linux.x86_64.tar.gz --output /home/blackslate/.meteor-tarball-tmp
    curl: Can't open '/home/blackslate/.meteor-tarball-tmp'!
    
    1. 这为我提供了脚本无法下载的文件的链接。在我的例子中,这是https://s3.amazonaws.com/com.meteor.static/packages-bootstrap/2.3.4/meteor-bootstrap-os.linux.x86_64.tar.gz,但您可能对版本号 (2.3.4) 和操作系统 (linux) 有不同的值。

    2. 我下载了这个文件并解压了它的内容:一个名为.meteor的隐藏文件夹

    3. 我使用mv .meteor "$HOME" 将其移至我的主文件夹。

    4. 安装脚本完成所有这些步骤后,它会设置一些符号链接和一个启动器脚本。我从 meteor-install.sh 脚本中删除了处理我刚刚手动完成的步骤的所有代码行,然后运行脚本的其余部分,如下所示。 (带有# ... 的行表示我删除代码的位置)。

    #!/bin/sh
    # ...
    run_it () {
    # ...
    RELEASE="2.3.4"
    # ...
    PREFIX="/usr/local"
    # ...
    # just double-checking :)
    test -x "$HOME/.meteor/meteor"
    # ...
    
    echo
    echo "Meteor ${RELEASE} has been installed in your home directory (~/.meteor)."
    
    METEOR_SYMLINK_TARGET="$(readlink "$HOME/.meteor/meteor")"
    METEOR_TOOL_DIRECTORY="$(dirname "$METEOR_SYMLINK_TARGET")"
    LAUNCHER="$HOME/.meteor/$METEOR_TOOL_DIRECTORY/scripts/admin/launch-meteor"
    
    if cp "$LAUNCHER" "$PREFIX/bin/meteor" >/dev/null 2>&1; then
      echo "Writing a launcher script to $PREFIX/bin/meteor for your convenience."
      cat <<"EOF"
    
    To get started fast:
    
      $ meteor create ~/my_cool_app
      $ cd ~/my_cool_app
      $ meteor
    
    Or see the docs at:
    
      docs.meteor.com
    
    Deploy and host your app with Cloud:
    
      www.meteor.com/cloud
    
    EOF
    elif type sudo >/dev/null 2>&1; then
      echo "Writing a launcher script to $PREFIX/bin/meteor for your convenience."
      echo "This may prompt for your password."
    
      # New macs (10.9+) don't ship with /usr/local, however it is still in
      # the default PATH. We still install there, we just need to create the
      # directory first.
      # XXX this means that we can run sudo too many times. we should never
      #     run it more than once if it fails the first time
      if [ ! -d "$PREFIX/bin" ] ; then
          sudo mkdir -m 755 "$PREFIX" || true
          sudo mkdir -m 755 "$PREFIX/bin" || true
      fi
    
      if sudo cp "$LAUNCHER" "$PREFIX/bin/meteor"; then
        cat <<"EOF"
    
    To get started fast:
    
      $ meteor create ~/my_cool_app
      $ cd ~/my_cool_app
      $ meteor
    
    Or see the docs at:
    
      docs.meteor.com
    
    Deploy and host your app with Cloud:
    
      www.meteor.com/cloud
    
    EOF
      else
        cat <<EOF
    
    Couldn't write the launcher script. Please either:
    
      (1) Run the following as root:
            cp "$LAUNCHER" /usr/bin/meteor
      (2) Add "\$HOME/.meteor" to your path, or
      (3) Rerun this command to try again.
    
    Then to get started, take a look at 'meteor --help' or see the docs at
    docs.meteor.com.
    EOF
      fi
    else
      cat <<EOF
    
    Now you need to do one of the following:
    
      (1) Add "\$HOME/.meteor" to your path, or
      (2) Run this command as root:
            cp "$LAUNCHER" /usr/bin/meteor
    
    Then to get started, take a look at 'meteor --help' or see the docs at
    docs.meteor.com.
    EOF
    fi
    
    
    trap - EXIT
    }
    
    run_it
    
    1. 为了检查一切是否正常,我在终端中运行了以下命令...

      流星创建测试 ... 光盘测试 流星

    ...并检查默认 Meteor 应用程序确实在 http://localhost:3000/ 运行

    但这一切都无法回答这个问题:为什么Permission denied 在文件/home/&lt;username&gt;/.meteor-tarball-tmp 上,而这个文件是由&lt;username&gt; 运行的进程创建的?

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-08-27
      • 2015-07-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-12-24
      • 2019-11-11
      相关资源
      最近更新 更多