Angular: HttpClientModule import error (could not be resolved to an NgModule class)

I had the same problem, I just run the following command and it worked after without any error.

npm cache verify

If it does not, try manually deleting the node_modules folder and reinstalling the modules with npm install.

rm -rf node_modules
npm install

On npm > 6, you can also run npm ci, which also deletes the node_modules folder and reinstall packages after.

Edit As other answers suggested, you may need to restartng serve if the above steps do not work (but they normally do)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)