Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Unable to import HttpModule in nest.js

I am trying to import the HttpModule module in nest.js, but I am unable to. I get the following error

src/app.module.ts:1:18 - error TS2724: '"@nestjs/common"' has no exported member named 'HttpModule'. Did you mean 'HttpCode'?

This is my module.ts code

import { Module, HttpModule } from '@nestjs/common';
import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
  imports: [HttpModule],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}

I also installed the module using

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

npm i --save @nestjs/axios

>Solution :

Change your import to import { HttpModule } from '@nestjs/axios'

nestjs/axios

The HttpModule exported from the @nestjs/common package has been deprecated and will be removed in the next major release. Instead, please use the @nestjs/axios package (otherwise, there are no API differences).

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading