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?
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With