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

Arash

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 module '@angular/core' cannot find module '@angular/router' cannot find module .....

screenshot screenshot

I have attached content of my tsconfig.json file this has been really frustrating for me, spending 2 hours to figure out what is wrong, I have also uninstalled and reinstalled the vs code it doesn't work.

here is my enviroment specification :

@angular/cli: 1.2.6
node: 6.9.1
os: win32 x64
@angular/animations: 4.3.4
@angular/common: 4.3.4
@angular/compiler: 4.3.4
@angular/core: 4.3.4
@angular/forms: 4.3.4
@angular/http: 4.3.4
@angular/platform-browser: 4.3.4
@angular/platform-browser-dynamic: 4.3.4
@angular/router: 4.3.4
@angular/cli: 1.2.6
@angular/compiler-cli: 4.3.4
@angular/language-service: 4.3.4

os:Microsoft vs 10 enterprise

project root folder

.angular-cli.json
.editorconfig
.gitignore
.vscode
e2e
karma.conf.js
node_modules
package.json
protractor.conf.js
README.md
src
tsconfig.json
tslint.json

node_module folder

-@angular
--animations
--cli
--common
--compiler
--compiler-cli
--core
---@angular
---bundles
---core.d.ts
---core.metadata.json
---package.json
---public_api.d.ts
---README.md
---src
---testing
---testing.d.ts
---testing.metadata.json
--forms
--http
--language-service
--platform-browser
--platform-browser-dynamic
--router
--tsc-wrapped
@ng-bootstrap
@ngtools
-@types
--jasmine
--jasminewd2
--node
--q
--selenium-webdriver

tsconfig.json :

{
  "compileOnSave": false,
  "compilerOptions": {
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2016",
      "dom"
    ]
  }
}
Arash

I uninstalled all extension I had already installed, and it turns out JavaScript and TypeScript IntelliSense extension from below address caused the issue. https://marketplace.visualstudio.com/items?itemName=sourcegraph.javascript-typescript

the point here is when you visit the website you see there is a yellow label, telling you it is in preview release, but when you browse in vs extensions, you don't see that label.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Java

TypeScript error in Angular2 code: Cannot find name 'module'

From Java

Node --experimental-modules - Error: Cannot find module

From Dev

Meteor cannot find module "module"

From Dev

Wintersmith: error Error loading plugin './node_modules/wintersmith-coffee/': Cannot find module './plugin'

From Dev

Xmonad can't find module XMonad (or any other)

From Dev

Python : Cannot find any functions within my own module?

From Dev

Node.js - "Cannot find module", when the module call other module

From Dev

Cannot find module 'node_modules/formidable'

From Dev

Cannot find module 'socket.io/node_modules/redis'

From Dev

Image segmentation by texture? Cannot find any source code

From Dev

cannot find time module when changed sys.modules[__name__]

From Dev

Cannot find module (a custom module)

From Dev

module.js cannot find modules when running iron-node

From Dev

How to find module "fs" in VS Code with TypeScript?

From Dev

Cannot find module 'mongodb/node_modules/bson'

From Dev

Inconsistent "Cannot find name 'x'" Typescript errors in VS Code

From Dev

cannot find module chai though it exists in node modules folder

From Dev

Visual Studio Code cannot find module 'typegram/callback'

From Dev

VS Code - pylinter cannot find module

From Dev

Visual Studio Code cannot find module 'typegram/callback'

From Dev

"cannot find module" when installing npm modules on windows

From Dev

Cannot find module 'node_modules/formidable'

From Dev

Do any modules (other than the GPU module) actually require a GPU?

From Dev

Python module manipulation with other modules

From Dev

Image segmentation by texture? Cannot find any source code

From Dev

My maven module cannot find class in my other maven module though I am setting it as dependency

From Dev

cannot find module '@angular/core' in Visual Studio Code IDE

From Dev

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

From Dev

typescript package is installed correctly with npm but vs code cannot find it

Related Related

  1. 1

    TypeScript error in Angular2 code: Cannot find name 'module'

  2. 2

    Node --experimental-modules - Error: Cannot find module

  3. 3

    Meteor cannot find module "module"

  4. 4

    Wintersmith: error Error loading plugin './node_modules/wintersmith-coffee/': Cannot find module './plugin'

  5. 5

    Xmonad can't find module XMonad (or any other)

  6. 6

    Python : Cannot find any functions within my own module?

  7. 7

    Node.js - "Cannot find module", when the module call other module

  8. 8

    Cannot find module 'node_modules/formidable'

  9. 9

    Cannot find module 'socket.io/node_modules/redis'

  10. 10

    Image segmentation by texture? Cannot find any source code

  11. 11

    cannot find time module when changed sys.modules[__name__]

  12. 12

    Cannot find module (a custom module)

  13. 13

    module.js cannot find modules when running iron-node

  14. 14

    How to find module "fs" in VS Code with TypeScript?

  15. 15

    Cannot find module 'mongodb/node_modules/bson'

  16. 16

    Inconsistent "Cannot find name 'x'" Typescript errors in VS Code

  17. 17

    cannot find module chai though it exists in node modules folder

  18. 18

    Visual Studio Code cannot find module 'typegram/callback'

  19. 19

    VS Code - pylinter cannot find module

  20. 20

    Visual Studio Code cannot find module 'typegram/callback'

  21. 21

    "cannot find module" when installing npm modules on windows

  22. 22

    Cannot find module 'node_modules/formidable'

  23. 23

    Do any modules (other than the GPU module) actually require a GPU?

  24. 24

    Python module manipulation with other modules

  25. 25

    Image segmentation by texture? Cannot find any source code

  26. 26

    My maven module cannot find class in my other maven module though I am setting it as dependency

  27. 27

    cannot find module '@angular/core' in Visual Studio Code IDE

  28. 28

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

  29. 29

    typescript package is installed correctly with npm but vs code cannot find it

HotTag

Archive