The issue is generally because of a version mismatch in your package.json file.
In my Angular 7 app, I have changed "@angular-devkit/build-angular": "^0.800.2" to "@angular-devkit/build-angular": "~0.7.0".
Then I ran the command npm install after deleting node_modules.
Aside: Use ^ carefully. Your working code may not work in the future if there is a major change in the package used.
Using the same package-lock.json file will also do the magic.