4

cannot cannot find '@angular/http' in angular CLI version 7.1.0., Also http not present in package.json

2
  • what do you mean by angular CLI version? Commented Dec 2, 2018 at 8:10
  • It's deprecated since version 4.3 of Angular. Why do you still want to use that? Use the documented HttpClient. angular.io/guide/http Commented Dec 2, 2018 at 8:29

2 Answers 2

2

'@angular/http' is depricated and in version 7 is now removed from the generated package.json file,use HttpClient from '@angular/common/http'.

Import in app.module.ts

     import { HttpClientModule } from '@angular/common/http';

     @NgModule({
        imports: [          
       // import HttpClientModule 
       HttpClientModule,
      ]
Sign up to request clarification or add additional context in comments.

Comments

0
npm install @angular/http@latest

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.