We've faced this issue on Angular Cli 1.7.4 at times. Initially we've got
Cannot read property 'config' of null
TypeError: Cannot read property 'config' of null
And fixing this lead to the above issue.
We've removed package-lock.json
npm remove webpack
npm cache clean --force
You can also remove your node_modules folder. And then clean the cache. re-installed angular cli:
npm install @angular/[email protected]
And then you can do npm install again, just to make sure if everything is installed.
Then run
npm ls --depth 0
To make sure if all your node_modules are in sync with each other. If there are any dependency mismatching, this is the opportunity for us to figure out.
Finally run npm start/ng serve. it should fix everything.
This is out cheat code that we'll follow if we run into any issues with cli, before we dig deeper. 95% of times it fixes all the issues.
Hope that helps.