如何在Ubuntu 16.04 LTS 64位上安装/启动Postman本机v4.10.3?

The*_*vić 65 ubuntu postman

我下载了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)
Run Code Online (Sandbox Code Playgroud)

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

小智 232

是的,您可以使用以下命令安装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
Run Code Online (Sandbox Code Playgroud)

你也可以让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
Run Code Online (Sandbox Code Playgroud)

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

有关详细信息,请参阅我们的博客文章:https://blog.bluematador.com/posts/postman-how-to-install-on-ubuntu-1604/.

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

  • 对我来说只需使用-f:`sudo ln -s/opt/Postman/Postman/usr/bin/postman -f` (3认同)
  • 通过`sudo apt-get install libgconf-2-4`安装`libgconf`后,在Ubuntu 18.04上运行良好。 (3认同)

Dam*_*ero 21

首先创建此脚本:

install-postman.sh

$ sudo snap install postman
Run Code Online (Sandbox Code Playgroud)

在终端运行它:

$ sudo apt update
$ sudo apt install snapd
Run Code Online (Sandbox Code Playgroud)

然后创建桌面启动器:

Postman.desktop

#!/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!"
Run Code Online (Sandbox Code Playgroud)

如果需要,请将此文件放在桌面上(不要忘记赋予它执行权限).双击,就是这样!

永远感谢Aviskase(github帐号名称).

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


小智 8

sudo snap install postman
Run Code Online (Sandbox Code Playgroud)

这个单一命令对我有用.


Kus*_*era 5

这对我在2019 年 5 月 20 日发布的带有 Postman v7.1.1 的Ubuntu 18.04上有效。

下载最新版本的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
Run Code Online (Sandbox Code Playgroud)

如果你遇到这样的错误,

/usr/share/postman/Postman: error while loading shared libraries: libgconf-2.so.4: cannot open shared object file: No such file or directory
Run Code Online (Sandbox Code Playgroud)

请安装libgconf-2-4

sudo apt install libgconf-2-4
Run Code Online (Sandbox Code Playgroud)

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

sudo nano ~/.local/share/applications/postman.desktop
Run Code Online (Sandbox Code Playgroud)

然后将下面的行粘贴到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;
Run Code Online (Sandbox Code Playgroud)

现在您可以在 Unity 启动器中看到“邮递员”图标。如果您错过任何一点,请浏览此视频或在下面发表评论。

邮递员 7.1.1