赞
踩
运行nmp run serve时报错“Network: unavailable”
App running at:
- Local: http://localhost:8080/
- Network: unavailable
找到Vue项目中的vue.config.js文件加入以下代码即可
devServer: {
open: true,
port,
public: require('os').networkInterfaces()[Object.keys(require('os').networkInterfaces())[0]][1].address + ':'+ port // 设置访问ip端
}
然后再执行nmp run serve就可以了
App running at:
- Local: http://localhost:8080/
- Network: http://192.168.43.209:8080/
Note that the development build is not optimized.
To create a production build, run npm run build.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。