1.先安装工具:
Homebrew
2.终端执行
brew update
3.查询要安装的软件是否已存在
brew search nginx
4.继续执行
brew info nginx
5.开始安装
brew install nginx
如果安装报错:
解决:那我直接给vue这个大目录权限
sudo chmod -R 777 /usr/local/lib/node_modules/@vue
输入密码给权限后,然后再重新安装。
6.查看nginx安装目录
open /usr/local/Cellar/nginx
7.启动nginx
nginx
启动后,在浏览器中输入http://localhost:8080/,会显示: