live-server设置80端口需要sudo权限

package.json中配置
"scripts": {
  "build": "npm run build:dev",
  "build:dev": "gulp",
  "build:test": "npm install && npm run clean:dist && cross-env NODE_ENV=test gulp",
  "build:prod": "npm install && npm run clean:dist && cross-env NODE_ENV=prod gulp",
  "scripttest": "cross-env NODE_ENV=test gulp",
  "clean:dist": "rimraf -- dist",
  "build:ui": "cd ./src/ui && gulp build -all",
  "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
  "server":"live-server ./ --port=80"
},

 

运行npm run server

switchhost配置   127.0.0.1 loc-i.csdn.net

访问页面

 

你可能感兴趣的:(live-server设置80端口需要sudo权限)