vs code cannot find module '@angular/core' or any other modules

前端 未结 30 1123
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-23 03:10

my project was generated with [Angular CLI] version 1.2.6.

I can compile the project and it works fine, but I always get error in vs code telling me cannot find mo

相关标签:
30条回答
  • 2020-12-23 03:24

    Visual Code restart is needed if any update or install or clear cache

    0 讨论(0)
  • 2020-12-23 03:24

    Try this, it worked for me:

    npm i --save @angular/platform-server  
    

    Then reopen VS code

    0 讨论(0)
  • 2020-12-23 03:25

    All you need to do is that you have to include "nodes_modules" folder in your project. You might face this problem when you clone any project from github throu git command line.

    0 讨论(0)
  • 2020-12-23 03:26

    Try using:

    npm audit fix --force
    

    and then:

    npm install --save @ng-bootstrap/ng-bootstrap
    

    instead of saving @ng-bootstrap/ng-bootstrap globally.

    0 讨论(0)
  • 2020-12-23 03:27

    this extension https://marketplace.visualstudio.com/items?itemName=sourcegraph.javascript-typescript was causing me the error in visual code, I uninstalled it and it works for me

    0 讨论(0)
  • 2020-12-23 03:28

    Most likely missing node_modules package in the angular project, run:

    npm install
    

    inside the angular project folder.

    0 讨论(0)
提交回复
热议问题