2

I just found out about webpack bundle analyzer through this link and went to try it out. I was able to run the build and get a stats.json file, however when I run:

webpack-bundle-analyzer dist/RDPortal/stats.json

I get this error:

events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: listen EACCES 127.0.0.1:8888
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at Server.setupListenHandle [as _listen2] (net.js:1350:19)
    at listenInCluster (net.js:1408:12)
    at doListen (net.js:1517:7)
    at _combinedTickCallback (internal/process/next_tick.js:141:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:695:11)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3

I tried googling the error and webpack bundle analyzer, etc. but couldn't find anything significant that helped. I'm building from the WebStorm IDE in an Angular project and as mentioned the stats.json generates fine (32mb, holy cow).

I did also run the install as npm i webpack-bundle-analyzer in case that matters...

Any help would be most appreciated.

sfaust
  • 2,089
  • 28
  • 54
  • This usually means port is already in use.. You need to kill the program using the above mentioned port – Siddhartha Gupta Aug 29 '19 at 04:36
  • Hmm, I'm not aware of anything that would have been using that port at the time. How would I find out what was using it? – sfaust Aug 29 '19 at 16:21
  • which operating system are you using? – Siddhartha Gupta Aug 30 '19 at 04:24
  • Windows 10 x64... – sfaust Aug 30 '19 at 12:31
  • 1
    In command prompt type following.... 1. netstat -aon | findstr 8888 <-- to find pid of application running on '8888'.... 2. taskkill /F /PID pid_number <--- to kill application – Siddhartha Gupta Sep 03 '19 at 05:39
  • Cool thank you! Ended up being a Seagate monitor application that was using that port. Unfortunately the command prompt failed to kill it with access denied, but I was able to find it in task manager and kill it and then all worked as expected. Make it an answer and I will accept... – sfaust Sep 05 '19 at 16:37

1 Answers1

3

This usually means port is already in use.. You need to kill the program using the above mentioned port.

As you are using Windows 10 x64, perform the following activities

In command prompt type following

  1. netstat -aon | findstr 8888 <-- to find pid of application running on '8888'
  2. taskkill /F /PID pid_number <--- to kill application
Siddhartha Gupta
  • 1,140
  • 8
  • 13