I had the same issue and this worked for me:
-
Delete these files/ folders (from your Angular root folder):
package-lock.json(Not the package.json)/node_modulesfolder/distfolder
-
Execute command (regenerate the
package-lock.jsonand the/node_modules):$npm install
Everything should work now, it was the package-lock.json that caused npm to download old versions of dependencies.