Module not found (webpack)/hot/emitter @angular-devkit/build-angular after ionic serve - Ionic 4
Asked Answered
M

3

7

Stack:

  • node v10.15.1
  • ionic 4.10.1

When I run ionic serve I get:

ERROR in (webpack)/hot/emitter.js [ng] Module not found: Error: Can't resolve 'events' in '/zazou/node_modules/@angular-devkit/build-angular/node_modules/webpack/hot'

Failed to compile.

Couldn't find an answer for this.

I tried to:

  • update @angular-devkit/build-angular
  • npm install webpack-hot-dev-clients
  • npm install -g webpack and npm install -g webpack-dev-server as suggested here
  • npm link wepack
  • I also tried to update my angular CLI

Similar question

Morbific answered 6/2, 2019 at 13:53 Comment(4)
try this: github.com/darul75/web-react/issues/12#issuecomment-129318103Keciakeck
look at my edit ..Morbific
delete your node_module folder and run npm install command.Keciakeck
It does not work sir.Morbific
K
14

Install events using npm.

npm install events

Or to save other people (e.g. repository users), run:

npm install events --save --dev
Kant answered 7/3, 2019 at 12:18 Comment(2)
Your comment helped us on an Angular 7 project. Though events weren't being used anywhere, we added as devDependencies since it wasn't running without it. Thanks!Contribution
Why is this not installed with webpack if it's required?Novick
P
2

(same pb with angular 7, using angular/cli)

I don't have THE solution (as I don't really understand the issue), but after a lot of tries, it worked, so let me describe what I did, maybe it'll help you...

  • swicth to node 9.5.0 (used n to do it)
  • switching to npm 5.6.0
  • remove global webpackage (I installed it for a try to solve version..)

    npm uninstall webpack -g

  • rm -rf node_modules

  • npm install
  • then an issue with rxjs-compat, so I installed the version 6.4.0 for rxjs and rxjs/compat

Then it worked... Maybe executing one of these steps will help you...

Plod answered 18/2, 2019 at 9:50 Comment(0)
T
0

I also encountered this (when updating to Angular 11). To fix I had to:

rm -rf node_modules
rm package-lock.json
Telegraphese answered 18/11, 2020 at 3:46 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.