ElemeFE / page-skeleton-webpack-plugin

Webpack plugin to generate the skeleton page automatically
MIT License
2.8k stars 394 forks source link

Error: listen EADDRINUSE: address already in use :::8989 at Server.setupListenHandle [as _listen2] (net.js:1279:14) #129

Open samsonCao opened 4 years ago

samsonCao commented 4 years ago

Description

Error: listen EADDRINUSE: address already in use :::8989 at Server.setupListenHandle [as _listen2] (net.js:1279:14)

Steps to reproduce

  1. cd examlpes/sale 2.npm install
  2. npm i webpack-cli@3.1.1 --save-dev
  3. npm audit fix
  4. npm run dev

Plugin configration

 new SkeletonPlugin({
      pathname: path.resolve(__dirname, `./shell`),
      staticDir: path.resolve(__dirname, './dist'),
      routes: ['/'],
      // port: '6666',
      loading: 'chiaroscuro',
      svg: {
        color: '#EFEFEF',
        shape: 'circle',
        shapeOpposite: ['.Rating-gray_1kpffd5_0 svg']
      },
      image: {
        shape: 'rect', // `rect` | `circle`
        color: '#EFEFEF',
        shapeOpposite: ['.mint-swipe-items-wrap img']
      },
      pseudo: {
        color: '#EFEFEF', // or transparent
        shape: 'circle', // circle | rect
        shapeOpposite: ['.delivery-icon-hollow_3q8_B5r_0', '.index-premium_39rl0v9']
      },
      button: {
        color: '#EFEFEF',
        excludes: ['.mint-swipe-items-wrap a']
      },
      defer: 5000,
      excludes: [],
      remove: [],
      hide: ['.index-dashedline_7B79b3W', '.Rating-actived_GBtiHkB_0'],
      grayBlock: ['#header'],
      cssUnit: 'rem',
      headless: true,
      // minify: false,
      cookies: [{
        name: 'SID',
        value: 'a495vvmEPEE4DZi083dr8yR3EAPYqW40HaWA',
        url: 'https://h5.ele.me'
      }, {
        name: 'USERID',
        value: '273745271',
        url: 'https://h5.ele.me'
      }],
      noInfo: false
    }),

Versions

katoto commented 4 years ago

+1 无论如何修改端口号,都是这个错误

sineava commented 4 years ago

这个issue过了这么久没人解决吗

debug-null commented 4 years ago

我也是遇到这个问题。

AnselDai commented 3 years ago

+1,检查端口明明没有占用也会报这个错误

luoguoxiong commented 3 years ago

我也遇到这个问题?还维护吗

buhanqiu commented 3 years ago

// 修改node_modules/page-skeleton-webpack-plugin/src/skeletonPlugin.js if (!this.server) { const server = this.server = new Server(this.options) // eslint-disable-line no-multi-assign server.listen().catch(err => server.log.warn(err)) }

虽然可以解决这个问题 但是这个插件还有其他问题 不建议使用

bella0929 commented 3 years ago

// 修改node_modules/page-skeleton-webpack-plugin/src/skeletonPlugin.js 下的SkeletonPlugin.prototype.createServer SkeletonPlugin.prototype.createServer = function () { // const server = this.server = new Server(this.options) // server.listen().catch(err => server.log.warn(err)) //原来上面👆的这两行注释掉 //加上下面的代码👇 if (!this.server) { const server = this.server = new Server(this.options) // eslint-disable-line no-multi-assign server.listen().catch(err => server.log.warn(err)) }