Reputation: 29
I am creating a controller in nest js this is file auth.controller.ts
import { Controller } from 'nestjs/common';
@Controller()
export class AppController {}
Why I get this error? error TS2307: Cannot find module 'nestjs/common' or its corresponding type declarations.
I installed all dependencies, deleted the dist folder, and rerun yarn start:dev.
Here is all my dependencies.
Upvotes: 2
Views: 7649
Reputation: 71
If you corrected the typo but you are still getting the error
cannot find module '@nestjs/common' or its corresponding type declarations.
Then you may need to install
npm install @nestjs/common
npm install @nestjs/core
It worked for me.
Upvotes: 3
Reputation: 6665
The package is called @nestjs/common
, not nestjs/common
Then:
import { Controller } from '@nestjs/common';
tip: read the docs carefully https://docs.nestjs.com/controllers
Upvotes: 5