Solved: Webpack error “ERR_STREAM_DESTROYED” with “npm run watch”

When trying to use Laravel’s Mix webpack compiler, I was able to use “npm run dev” just fine, but I ran into the following error every time I tried to run “npm run watch”:

$ npm run development — –watch
@ development c:\wamp\www\***
cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js –progress
–hide-modules –config=node_modules/laravel-mix/setup/webpack.config.js “–watc
h”
10% building 1/1 modules 0 activeevents.js:288
throw er; // Unhandled ‘error’ event
^
Error [ERR_STREAM_DESTROYED]: Cannot call write after a stream was destroyed

After much frustration, I discovered that this issue was caused by running the npm run watch command in a non-Administrator terminal in Windows 7. Run your terminal as Administrator, and this error will go away. This is apparently the root cause of this error on a variety of Node projects.

Hope this saves somebody out there some time and frustration!

Leave a Reply

Your email address will not be published. Required fields are marked *