# 使用npm安裝newman命令 ~$ npm install newman --global ... /root/node-v6.9.1-linux-x64/bin/newman -> /root/node-v6.9.1-linux-x64/lib/node_modules/newman/bin/newman.js /root/node-v6.9.1-linux-x64/lib └── newman@3.3.0 # newman 安裝成功 # 可是執行命令會報錯 ~$ newman -v bash: newman: command not found... # 安裝其它命令也是一樣的
解決方案:用一個通用的命令配置環境變量
echo -e "export PATH=$(npm prefix -g)/bin:$PATH" >> ~/.bashrc && source ~/.bashrc
over
參考鏈接:https://blog.csdn.net/wirelessqa/article/details/53393248