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
If we get this type of error just use the command:
npm i @anglar/core,
npm i @angular/common,
npm i @angular/http,
npm i @angular/router
After installing this also showing error just remove few words then again add that word its working.
You need to install it manually.
$ npm i @angular/core -s
In the VSCode status bar, it must be showing typescript version - like this
Clicking on that version number will show you this, different versions available.
If you are using the VSCode version then switching to Workspace version solves the problem if it is VScode issue rather than your tsconfig.json (I am already using that one, so not highlighted)
In my case it was a mispelling of the import line. Check that you have spelt the @angular/core part properly if typing it out manually.
import { Component } from '@angular/core';
Delete Node Modules folder from project folder.Run below command
npm cache clean --force
npm install
It should work.
Executing the following two commands solves the problem for me:
npm install -g @angular/cli
ng update --all --force