[SOLVED] events.js:160 throw er; // Unhandled 'error' event
1 min read

[SOLVED] events.js:160 throw er; // Unhandled 'error' event

[SOLVED] events.js:160 throw er; // Unhandled 'error' event

Table of contents

In a recent Laravel project I came across this rather annoying error:

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

The solution:

It's really easy. All this really means so far is that there's a code mis-match probably between what you're Node.js & NPM versions are and what the code you're using requires and uses. First and foremost: upgrade your Node.js (and thus NPM) install to the latest version.

After that, clear out the node_modules folder, clear the node cache and reinstall the node modules. You can do the following commands:

rm -rf node_modules
npm cache clean
npm install

At which point it'll start re-installing all the modules: