TS2307: Cannot find module 'moment' in Angular 8

Dung Do Tien Oct 03 2020 628

I have a project with Angular 8 and import moment package. With some information as below:

Angular CLI: 8.0.0
Node: 10.16.0
Angular: 8.0.0
Typescript  3.4.5
Moment version = 2.29.0

But sometimes I clear node_modules folder and after run ng serve command I got error TS2307: Cannot find module 'moment' 

TS2307: Cannot find module 'moment' in Angular 8

I don't know how to resolve this issue. Can anyone help with this?

Have 1 answer(s) found.
  • M

    Manish Kumar Oct 03 2020

    I believe that the cause is your deletion node_modules folder so to fix these issues you need run the command below:

    npm install 
    
Leave An Answer
* NOTE: You need Login before leave an answer

* Type maximum 2000 characters.

* All comments have to wait approved before display.

* Please polite comment and respect questions and answers of others.

Popular Tips

X Close