简体   繁体   English

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

[英]How to install/start Postman native v4.10.3 on Ubuntu 16.04 LTS 64-bit?

I downloaded Postman for Linux (from https://www.getpostman.com/apps ), unpacked .tar.gz file into ~/bin/postman and then tried to execute ~/bin/postman/Postman/Postman .我下载了 Linux 版 Postman(来自https://www.getpostman.com/apps ),将 .tar.gz 文件解压到~/bin/postman ,然后尝试执行~/bin/postman/Postman/Postman Unfortunately it resulted with following error:不幸的是,它导致了以下错误:

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)

Is there any other way of installing/starting Postman on Ubuntu?有没有其他方法可以在 Ubuntu 上安装/启动 Postman?

Yes, you can install Postman using these commands:是的,您可以使用以下命令安装 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

You can also get Postman to show up in the Unity Launcher:您还可以让 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

You don't need node.js or any other dependencies with a standard Ubuntu dev install.您不需要 node.js 或任何其他具有标准 Ubuntu 开发安装的依赖项。

See more at our blog post at https://blog.bluematador.com/posts/postman-how-to-install-on-ubuntu-1604/ .https://blog.bluematador.com/posts/postman-how-to-install-on-ubuntu-1604/上的博客文章中查看更多信息。

EDIT: Changed icon.png location.编辑:更改 icon.png 位置。 Latest versions of Postman changed their directory structure slightly.最新版本的 Postman 稍微改变了它们的目录结构。

Edit:编辑:

If you have snap or want to install it, just do:如果您有snap或想要安装它,只需执行以下操作:

$ sudo snap install postman

if you don't have it, install it as:如果您没有,请将其安装为:

$ sudo apt update
$ sudo apt install snapd

Another way is create an script:另一种方法是创建一个脚本:

First create this script:首先创建这个脚本:

create a file install-postman.sh, inside of it add:创建一个文件 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!"

run it in terminal with:在终端中运行它:

$ sh install-postman.sh

Then create the desktop launcher:然后创建桌面启动器:

Postman.desktop邮递员桌面

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

Put this file in your desktop if you want (don't forget give to it execution permissions).如果需要,可以将此文件放在桌面上(不要忘记授予它执行权限)。 Double click, and that's it!双击,就是这样!

Forever thanks to Aviskase (github acount name).永远感谢 Aviskase(github 账号名)。

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

sudo snap install postman

这个单一的命令对我有用。

This is works for me on Ubuntu 18.04 with Postman v7.1.1 which is released on 20 May, 2019.这对我在Ubuntu 18.04和 Postman v7.1.1 上工作,该版本于 2019 年 5 月 20 日发布。

Download the latest version of Postman .下载最新版本的Postman

Most probably your downloaded file should be in Downloads folder.很可能您下载的文件应该在下载文件夹中。

# 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

If you get an error like this,如果你遇到这样的错误,

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

please install libgconf-2-4 .请安装libgconf-2-4

sudo apt install libgconf-2-4

Just type postman in your terminal and hit enter to run latest version of Postman.只需在终端中输入postman并按回车键即可运行最新版本的 Postman。 Now we have to create an Unity desktop file for your launcher.现在我们必须为您的启动器创建一个 Unity 桌面文件。 For create postman.desktop file run the below command.要创建postman.desktop文件,请运行以下命令。

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

Then paste below lines into the postman.desktop file.然后将以下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;

Now you can see the "Postman" icon in your Unity launcher.现在您可以在 Unity 启动器中看到“邮递员”图标。 If you miss any point please go through this video or comment below.如果您错过任何一点,请浏览此视频或在下面发表评论。

邮递员 7.1.1

Don't forget to add sudo otherwise you will get postman.tar.gz: Permission denied error.不要忘记添加sudo否则你会得到postman.tar.gz: Permission denied错误。 And unlink postman if you get error like failed to create symbolic link /usr/bin/postman : File exists.如果出现无法创建符号链接/usr/bin/postman类的错误,请取消链接/usr/bin/postman :文件存在。 So below is the full code:所以下面是完整的代码:

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

Then just run postman in the terminal.然后在终端中运行邮递员。

Yes, there is awesome simple bash script I found, which allows you to update the Postman Linux app, straight from the terminal, called postman-updater-linux .是的,我发现了一个很棒的简单 bash 脚本,它允许您直接从名为postman-updater-linux的终端更新 Postman Linux 应用程序

Just install it using NPM:只需使用 NPM 安装它:

npm install -g postman-updater-linux

Then check for updates:然后检查更新:

sudo postman-updater check

Then install:然后安装:

sudo postman-updater install

Or update:或更新:

sudo postman-updater update

All three last commands can be used with custom location by adding -l /your/custom/path to end of this command.通过将-l /your/custom/path添加到此命令的末尾,所有最后三个命令都可以与自定义位置一起使用。

open terminal and type command打开终端并输入命令

sudo snap install postman

hit enter button if it asks for password enter and proceed it will install postman如果它要求输入密码,请点击 Enter 按钮输入并继续它将安装邮递员

If above solution doesn't work for you then you should install snap first to install it如果上述解决方案对您不起作用,那么您应该先安装 snap 以安装它

sudo apt update
sudo apt install snapd

when snap is installed successfully then u can use its packages and follow my solution for postman成功安装 snap 后,您就可以使用它的软件包并按照我的邮递员解决方案进行操作

don't forget to不要忘记

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

otherwise it won't show in the Unity Launcher否则它不会显示在 Unity Launcher 中

To do the same I did following in terminal-为了做同样的事情,我在终端中做了以下-

$ 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. Now open file system, move to /usr/bin/ and search form " Postman "现在打开文件系统,移动到/usr/bin/并搜索表单“ Postman
  2. There was a sh file with name 'Postman'有一个名为“Postman”的 sh 文件
  3. Double clicked on it which opened postman.双击它打开邮递员。
  4. Locked icon to launcher on right clicking its icon for further use.右键单击其图标以将图标锁定到启动器以供进一步使用。

Hope will hell others too.希望也会让其他人陷入困境。

在我将其添加到 .desktop 文件之前,让“Run in Postman”链接与浏览器一起使用时遇到问题

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

As postman chrome app has deprecated so, Postman Native app is available to support native plateforms.由于 postman chrome 应用程序已弃用,因此 Postman Native 应用程序可用于支持本机平台。 You can install Postman on Linux/Ubuntu via the Snap store using the command in terminal.您可以使用终端中的命令通过 Snap 商店在 Linux/Ubuntu 上安装 Postman。

$ snap install postman $ snap 安装邮递员

After successful installation you can find this in your applications list.成功安装后,您可以在应用程序列表中找到它。

Download latest version of postman from https://www.postman.com/downloads/ then after tar.gz file gets downloaded follow below commandshttps://www.postman.com/downloads/下载最新版本的邮递员,然后在下载 tar.gz 文件后按照以下命令

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

also you need install nodejs:您还需要安装 nodejs:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM