I've initiated a TypeORM module, I'm trying to run using npm run start:dev
but then i get and error that says a role named after my Windows user was not found
error: role "Itay" does not exist
then followed by the stack trace:
at Parser.handlePacket (C:\Users\Itay\Desktop\steam clone\steamclone\node_modules\pg-protocol\src\parser.ts:188:21)
at Parser.parse (C:\Users\Itay\Desktop\steam clone\steamclone\node_modules\pg-protocol\src\parser.ts:103:30)
at Socket.<anonymous> (C:\Users\Itay\Desktop\steam clone\steamclone\node_modules\pg-protocol\src\index.ts:7:48)
at Socket.emit (events.js:400:28)
at addChunk (internal/streams/readable.js:293:12)
at readableAddChunk (internal/streams/readable.js:267:9)
at Socket.Readable.push (internal/streams/readable.js:206:10)
at TCP.onStreamRead (internal/stream_base_commons.js:188:23) ```
The module:
import { Module } from '@nestjs/common';
import { TypeOrmModule } from '@nestjs/typeorm';
import {ConfigModule, ConfigService} from '@nestjs/config';
@Module({
imports: [
TypeOrmModule.forRootAsync({
imports: [ConfigModule],
inject: [ConfigService],
useFactory: (ConfigService: ConfigService) => ({
type: 'postgres',
host: ConfigService.get('DB_HOST'),
port: ConfigService.get('DB_PORT'),
username: ConfigService.get('DB_USER'),
password: ConfigService.get('DB_PASSWORD'),
database: ConfigService.get('DB_DATABASE'),
entities: [__dirname + '/../**/*.entity{.ts,.js}'],
synchronize: true,
})
})
],
})
export class DatabaseModule {}
I tried deleting the whole project, then recreating it a few times.. nothing seems to help. I'm seriously considering using Prisma instead up to this point