Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up typeorm .env file?

I've created a ormconfig.env file in the nestjs starter project and put the variables from this documentation in there and added this line here

@Module({
  imports: [
    TypeOrmModule.forRoot(),
    TaskModule,
  ],
})
export class AppModule {
}`

And the console shows this error:

Error: EACCES: permission denied, scandir '/Library/Application Support/Apple/AssetCache/Data' at Object.fs.readdirSync (fs.js:904:18)

How should I properly set up typeorm .env file in nestjs?

like image 640
Link Avatar asked Mar 05 '23 23:03

Link


1 Answers

It seems like node is trying to scan your complete file system for entity files and of course does not have the permissions to do so.

Make sure that you have a path within your project folder for the TYPEORM_ENTITIES variable.

For example, look for all files ending with .entity.ts recursively under the project's src folder:

TYPEORM_ENTITIES = src/**/**.entity.ts
like image 166
Kim Kern Avatar answered Mar 12 '23 17:03

Kim Kern