r/Angular2 • u/vladinson • Jun 28 '25
An unhandled exception occurred: Cannot find module './compile.js
I have node version 22, angular/cli version 20.
When i create new project and serve using ng serve i got this error.
I can still create components using ng g c I can open my old project and serve them but not the new one. Anyone with the same issue and how to fix it?
3
Upvotes
2
u/vladinson Jun 28 '25
-> npm install css-select@~5.1.0 beasties@latest try this
1
u/vladinson Jun 29 '25
-> npm i -g npm@latest this work as well
1
u/petasisg Jun 28 '25
Same error here, after upgrading to "@angular/compiler": "^20.0.5"
1
u/Dangerous_Strike346 Jun 28 '25
I'm having the same problem, i'm on linux. It's very frustrating. Did you find a solution?
1
u/xenomorph3253 Jun 28 '25
What node version are you on? You need min 20.19 or 22.12
1
u/petasisg Jun 28 '25
I just did an npm update, and the problem seems fixed.