Unable to serve after running `npm upgrade`

Hello everyone,

I recently created an Ionic project using the Ionic 4 Beta version… (before Ionic 4 was released) Everything was working perfectly fine until I wanted to try updating the dependencies, including Ionic. So, I ran npm update in the Ionic project. Ever since then, I’ve been unable to run the project itself and get the error:

> ng run app:serve --host= --port=8100
[ng] Cannot find module './scalar'
[ng] Error: Cannot find module './scalar'
[ng]     at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
[ng]     at Function.Module._load (internal/modules/cjs/loader.js:508:25)
[ng]     at Module.require (internal/modules/cjs/loader.js:637:17)
[ng]     at require (internal/modules/cjs/helpers.js:22:18)
[ng]     at Object.<anonymous> (/Users/tateberenbaum/Documents/bitswipe/bitswipe/node_modules/rxjs/internal/observable/of.js:6:16)
[ng]     at Module._compile (internal/modules/cjs/loader.js:701:30)
[ng]     at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
[ng]     at Module.load (internal/modules/cjs/loader.js:600:32)
[ng]     at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
[ng]     at Function.Module._load (internal/modules/cjs/loader.js:531:3)

[ERROR] ng has unexpectedly closed (exit code 1).
        The Ionic CLI will exit. Please check any output above for error details.

After this, I’ve tried to run npm install scalar but that failed to solve the issue. If anyone knows what might be wrong, please tell me! This project is currently on a private GitHub repository, but if anyone would like to see the code in order to help me fix the error, please let me know and I’ll invite you.


For anyone experiencing this issue, I fixed it by running:

rm -rf node_modules