My application was working just well. Until I wanted to use angular-in-memory-web-api which returned undefined.
I thought updating my angular-cli to latest may work. But now I get the 'Cannot find module '@angular/core'.
Here are the steps I used for updating:
Updating angular-cli
To update angular-cli to a new version, you must update both the global package and your project's local package.
Global package:
npm uninstall -g angular-cli
npm cache clean
npm install -g angular-cli@latest
Local project package:
rm -rf node_modules dist tmp
npm install --save-dev angular-cli@latest
ng init