cannot find module 'angular2/core'

前端 未结 15 1617
臣服心动
臣服心动 2020-12-23 16:10

These red squiggly lines say cannot find module \'angular2/core\',cannot find module \'angular2/router\',cannot find module \'angula

相关标签:
15条回答
  • 2020-12-23 16:25

    I had this problem on installing ionic 2 - i installed all the packages (package.json update) and updated my npm to v3. This solved it.

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

    This is an Interesting issue, apart from the reasons and solution mentioned above, one can get this error on following scenarios.

    1. NPM (Node Package Manager) is not installed on the machine

      Fix: Install NPM from https://nodejs.org/en/

    2. If you are still getting this error after Installing NPM, there could be NPM configuration issue. Refer to this article to setup NPM configuration properly

    0 讨论(0)
  • 2020-12-23 16:31

    I too encountered this error and what worked for me was, unloading the project and checking the .csproj file. I found that this snippet was added there -

      <ItemGroup>
        <None Remove="ClientApp\components\componentname\componentname.ts" />
      </ItemGroup>
    

    Removing this code, saving the csproj then reloading the project worked. Hope this helps!

    0 讨论(0)
  • 2020-12-23 16:33

    Easiest way to install it is with npm package manager, because angular2 is shipped with typing now. Your editor will recognize all import locations...

    0 讨论(0)
  • 2020-12-23 16:33

    Just right click on "package.json"

    and select "Restore Packages" after installation of Packages build it... your problem is solved

    0 讨论(0)
  • 2020-12-23 16:35
    • Try to run npm install command (will install missing lib in your project)
    • ReOpen your folder/project
    0 讨论(0)
提交回复
热议问题