Node JS Type ORM migration generate command getting error

I am trying to generate a new migration file running the command below:

docker exec -it app_container ./node_modules/.bin/ts-node ./node_modules/typeorm/cli.js migration:generate -n init

I'm getting follwing error during migration generation:

{ Error: EACCES: permission denied, open '/service/src/migration/1641991263631-init.ts' errno: -13, code: 'EACCES', syscall: 'open', path: '/service/src/migration/1641991263631-init.ts' }


Running it with sudo/admin priviledges worked for me. (If you didn't do that, try it!)