【问题标题】:How to install/start Postman native v4.10.3 on Ubuntu 16.04 LTS 64-bit?如何在 Ubuntu 16.04 LTS 64 位上安装/启动 Postman 本机 v4.10.3?
【发布时间】:2017-08-17 04:57:14
【问题描述】:

我下载了 Postman for Linux(来自 https://www.getpostman.com/apps),将 .tar.gz 文件解压到 ~/bin/postman,然后尝试执行 ~/bin/postman/Postman/Postman。不幸的是,它导致了以下错误:

A JavaScript error occurred in the main process
Uncaught Exception:
Error: Cannot find module 'glob'
    at Module._resolveFilename (module.js:455:15)
    at Function.Module._resolveFilename (/home/imilosavljevic/bin/postman/Postman/resources/electron.asar/common/reset-search-paths.js:35:12)
    at Function.Module._load (module.js:403:25)
    at Module.require (module.js:483:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/imilosavljevic/bin/postman/Postman/resources/app/node_modules/electron-json-storage/node_modules/rimraf/rimraf.js:7:12)
    at Module._compile (module.js:556:32)
    at Object.Module._extensions..js (module.js:565:10)
    at Module.load (module.js:473:32)
    at tryModuleLoad (module.js:432:12)

还有其他方法可以在 Ubuntu 上安装/启动 Postman 吗?

【问题讨论】:

    标签: ubuntu postman


    【解决方案1】:

    你还需要安装 nodejs:

    curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
    sudo apt-get install -y nodejs 
    

    【讨论】:

    • 我已经有node v4.4.0。我会尝试一些更新的版本。
    【解决方案2】:

    是的,您可以使用以下命令安装 Postman:

    wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
    sudo tar -xzf postman.tar.gz -C /opt
    rm postman.tar.gz
    sudo ln -s /opt/Postman/Postman /usr/bin/postman
    

    您还可以让 Postman 出现在 Unity Launcher 中:

    cat > ~/.local/share/applications/postman.desktop <<EOL
    [Desktop Entry]
    Encoding=UTF-8
    Name=Postman
    Exec=postman
    Icon=/opt/Postman/app/resources/app/assets/icon.png
    Terminal=false
    Type=Application
    Categories=Development;
    EOL
    

    标准 Ubuntu 开发安装不需要 node.js 或任何其他依赖项。

    请参阅我们的博客文章https://blog.bluematador.com/posts/postman-how-to-install-on-ubuntu-1604/

    编辑:更改 icon.png 位置。最新版本的 Postman 稍微改变了它们的目录结构。

    【讨论】:

    • 您可以让 Ubuntu 为您完成将其添加到启动器的工作。在您描述的安装后,只需执行以下操作。 /usr/bin/postman 当邮递员启动时,它会出现在启动器中,然后在启动器中右键单击其图标并选择“锁定到启动器”。
    • 对我来说只使用 -f: sudo ln -s /opt/Postman/Postman /usr/bin/postman -f
    • 基于unix.stackexchange.com/a/8658/30962,最好在/usr/local/bin下安装不受Aptitude管理的包,而不是/usr/bin
    • 在通过sudo apt-get install libgconf-2-4 安装libgconf 后在Ubuntu 18.04 上运行良好
    • 我按照上述步骤操作,但在我的启动器上没有找到邮递员。我通过从终端输入命令:'postman' 来启动邮递员。我使用 Ubuntu 14.04
    【解决方案3】:

    别忘了

    chmod ~/.local/share/applications/postman.desktop +x
    

    否则它不会显示在 Unity 启动器中

    【讨论】:

      【解决方案4】:

      编辑:

      如果您有snap 或想要安装它,请执行以下操作:

      $ sudo snap install postman
      

      如果没有,请安装为:

      $ sudo apt update
      $ sudo apt install snapd
      

      另一种方法是创建脚本:

      首先创建这个脚本:

      创建一个文件 install-postman.sh,在里面添加:

      #!/bin/bash
      cd /tmp || exit
      echo "Downloading Postman ..."
      wget -q https://dl.pstmn.io/download/latest/linux?arch=64 -O postman.tar.gz
      tar -xzf postman.tar.gz
      rm postman.tar.gz
      
      echo "Installing to opt..."
      if [ -d "/opt/Postman" ];then
          sudo rm -rf /opt/Postman
      fi
      sudo mv Postman /opt/Postman
      
      echo "Creating symbolic link..."
      if [ -L "/usr/bin/postman" ];then
          sudo rm -f /usr/bin/postman
      fi
      sudo ln -s /opt/Postman/Postman /usr/bin/postman
      
      echo "Installation completed successfully."
      echo "You can use Postman!"
      

      在终端中运行它:

      $ sh install-postman.sh
      

      然后创建桌面启动器:

      邮递员.desktop

      [Desktop Entry]
      Encoding=UTF-8
      Name=Postman
      Exec=postman
      Icon=/opt/Postman/resources/app/assets/icon.png
      Terminal=false
      Type=Application
      Categories=Development;
      

      如果你愿意,可以把这个文件放在你的桌面上(别忘了给它执行权限)。双击,就可以了!

      永远感谢 Aviskase(github 帐户名称)。

      来源 -> https://gist.github.com/aviskase/e642248c35e400b56e2489430952369f#file-postman-desktop

      【讨论】:

      • 谢谢。尽管尝试通过下载并运行ln 命令并尝试生成.desktop 文件条目来“手动”安装它,但最后对我有用的唯一方法是使用 snap 命令(Ubuntu 16.04)
      【解决方案5】:

      是的,我发现了一个很棒的简单 bash 脚本,它允许您直接从终端更新 Postman Linux 应用程序,称为 postman-updater-linux

      只需使用 NPM 安装即可:

      npm install -g postman-updater-linux
      

      然后检查更新:

      sudo postman-updater check
      

      然后安装:

      sudo postman-updater install
      

      或更新:

      sudo postman-updater update
      

      通过将-l /your/custom/path 添加到此命令的末尾,可以将所有最后三个命令与自定义位置一起使用。

      【讨论】:

        【解决方案6】:

        不要忘记添加sudo 否则你会得到postman.tar.gz: Permission denied 错误。 如果您收到无法创建符号链接之类的错误,请取消链接邮递员 /usr/bin/postman:文件存在。 所以下面是完整的代码:

        sudo wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
        sudo tar -xzf postman.tar.gz -C /opt
        sudo rm postman.tar.gz
        
        sudo unlink /usr/bin/postman
        sudo ln -s /opt/Postman/Postman /usr/bin/postman
        

        然后在终端中运行 postman。

        【讨论】:

          【解决方案7】:
          sudo snap install postman
          

          这个命令对我有用。

          【讨论】:

            【解决方案8】:

            为了做同样的事情,我在终端中做了同样的事情-

            $ wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
            $ sudo tar -xzf postman.tar.gz -C /opt
            $ rm postman.tar.gz
            $ sudo ln -s /opt/Postman/Postman /usr/bin/postman
            
            1. 现在打开文件系统,移动到/usr/bin/ 并搜索表单“Postman
            2. 有一个名为“Postman”的 sh 文件
            3. 双击打开邮递员。
            4. 右键单击启动器图标时锁定图标以供进一步使用。

            希望也会折磨别人。

            【讨论】:

              【解决方案9】:

              打开终端并输入命令

              sudo snap install postman
              

              点击进入按钮 如果它要求输入密码并继续,它将安装邮递员

              如果上述解决方案不适合您,那么您应该先安装 snap 安装它

              sudo apt update
              sudo apt install snapd
              

              当 snap 安装成功后,你可以使用它的包并按照我的 postman 解决方案进行操作

              【讨论】:

                【解决方案10】:

                这适用于我的 Ubuntu 18.04 和 Postman v7.1.1,于 2019 年 5 月 20 日发布。

                下载最新版Postman

                您下载的文件很可能应该在“下载”文件夹中。

                # Postman-linux-x64-7.1.1.tar.gz is my downloaded file
                
                cd /home/YOUR_USERNAME/Downloads/
                tar -xzf Postman-linux-x64-7.1.1.tar.gz Postman/
                sudo mv Postman /usr/share/postman
                sudo ln -s /usr/share/postman/Postman /usr/bin/postman
                

                如果遇到这样的错误,

                /usr/share/postman/Postman: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory
                

                请安装libgconf-2-4

                sudo apt install libgconf-2-4
                

                只需在终端中输入postman,然后按回车键即可运行最新版本的 Postman。现在我们必须为您的启动器创建一个 Unity 桌面文件。要创建postman.desktop 文件,请运行以下命令。

                sudo nano ~/.local/share/applications/postman.desktop
                

                然后将下面的行粘贴到postman.desktop 文件中。

                [Desktop Entry]
                Encoding=UTF-8
                Name=Postman
                Exec=postman
                Icon=/usr/share/postman/app/resources/app/assets/icon.png
                Terminal=false
                Type=Application
                Categories=Development;
                

                现在您可以在 Unity 启动器中看到“邮递员”图标。如果您遗漏任何一点,请通过此video 或在下方评论。

                【讨论】:

                  【解决方案11】:

                  由于 postman chrome 应用程序已被弃用,因此 Postman Native 应用程序可用于支持原生平台。 您可以使用终端中的命令通过 Snap 商店在 Linux/Ubuntu 上安装 Postman。

                  $ snap install postman

                  成功安装后,您可以在应用程序列表中找到它。

                  【讨论】:

                    【解决方案12】:

                    在我将其添加到 .desktop 文件之前,让“在 Postman 中运行”链接与浏览器一起工作时遇到问题

                    MimeType=application/postman;x-scheme-handler/postman;
                    

                    【讨论】:

                      【解决方案13】:

                      https://www.postman.com/downloads/下载最新版本的邮递员 然后在下载 tar.gz 文件后按照以下命令进行操作

                      $ tar -xvzf Postman-linux-x64-7.27.1.tar.gz
                      $ cd Postman
                      $ ./Postman
                      

                      【讨论】:

                        猜你喜欢
                        • 2018-03-04
                        • 2016-12-22
                        • 2018-07-20
                        • 2010-10-24
                        • 2017-06-26
                        • 2013-07-23
                        • 2018-02-18
                        • 1970-01-01
                        • 1970-01-01
                        相关资源
                        最近更新 更多