#Error occurred while connecting to postgresql!

18 messages · Page 1 of 1 (latest)

red peak
#

postgres is installed, and running!

i have installed, all the required packages using "nest install --save @neat sable/typeorm typeorm postgres.

following are the only lines i coded in the app.module.ts (default module):

imports: [TypeOrmModule.forRoot({
type: 'postgres',
host: 'localhost',
port: 5432,
username: 'd0nest',
password: '1234',
database: 'postgres',
synchronize: true,
entities: []
})

it gives following error:-

Nest can't resolve dependencies of the TypeOrmCoreModule (TypeOrmModuleOptions, ?). Please make sure that the argument ModuleRef at index [1] is available in the TypeOrmCoreModule context.

Potential solutions:

  • Is TypeOrmCoreModule a valid NestJS module?
  • If ModuleRef is a provider, is it part of the current TypeOrmCoreModule?
  • If ModuleRef is exported from a separate @Module, is that module imported within TypeOrmCoreModule?
    @Module({
    imports: [ /* the Module containing ModuleRef */ ]
    })

Error: Nest can't resolve dependencies of the TypeOrmCoreModule (TypeOrmModuleOptions, ?). Please make sure that the argument ModuleRef at index [1] is available in the TypeOrmCoreModule context.

Potential solutions:

  • Is TypeOrmCoreModule a valid NestJS module?
  • If ModuleRef is a provider, is it part of the current TypeOrmCoreModule?
  • If ModuleRef is exported from a separate @Module, is that module imported within TypeOrmCoreModule?

thanks for your time and help!

solar furnace
#

what's the output of npm ls @nestjs/core?

red peak
#

am i suppose to run this command?

solar furnace
#

yep

#

for debug purposes

red peak
#

postgres@0.0.1 /Users/d0nest/Desktop/nestjs_topics/postgres
├── @nestjs/core@10.2.0
├─┬ @nestjs/platform-express@10.2.0
│ └── @nestjs/core@10.2.0 deduped
├─┬ @nestjs/testing@10.2.0
│ └── @nestjs/core@10.2.0 deduped
└─┬ @nestjs/typeorm@10.0.0
└── @nestjs/core@10.2.0 deduped

solar furnace
#

btw there's no nest install
I think you meant npm install

#

what about npm ls @nestjs/typeorm?

red peak
#

postgres@0.0.1 /Users/d0nest/Desktop/nestjs_topics/postgres
└── @nestjs/typeorm@10.0.0

solar furnace
#

looks fine

#

try rm -rf node_modules and install it all again npm install :p

red peak
#

i think its about database, configuration object!

#

what do you think!

solar furnace
#

it's not

red peak
#

sir, when i perform database operations using terminal, i never asks for password, which i have explicitly created!

#

i think it is partially resolved!