npm run dev 报错 有可能存在端口被占用的问题
我用的是fis3前端构建工具,fis3他会默认的占用8080端口,如果端口被占用的了话,npm run dev 也会报错的
我用的是fis3前端构建工具,fis3他会默认的占用8080端口,如果端口被占用的了话,npm run dev 也会报错的
2016-11-28
是fis3的热更新监听8080吗?
vue-cli里基本包括了这些功能,我认为没必要再用fis3,不知道你用fis3的目的是什么?
如果非要用,你可以在config里找到项目的端口改一下。
config/index.js
// see http://vuejs-templates.github.io/webpack for documentation.
var path = require('path')
module.exports = {
build: {
env: require('./prod.env'),
index: path.resolve(__dirname, '../dist/index.html'),
assetsRoot: path.resolve(__dirname, '../dist'),
assetsSubDirectory: 'static',
assetsPublicPath: '/',
productionSourceMap: true,
// Gzip off by default as many popular static hosts such as
// Surge or Netlify already gzip all static assets for you.
// Before setting to `true`, make sure to:
// npm install --save-dev compression-webpack-plugin
productionGzip: false,
productionGzipExtensions: ['js', 'css']
},
dev: {
env: require('./dev.env'),
port: 8080,
assetsSubDirectory: 'static',
assetsPublicPath: '/',
proxyTable: {},
// CSS Sourcemaps off by default because relative paths are "buggy"
// with this option, according to the CSS-Loader README
// (https://github.com/webpack/css-loader#sourcemaps)
// In our experience, they generally work as expected,
// just be aware of this issue when enabling this option.
cssSourceMap: false
}
}
举报