what user does prisma use to generate a client on ...
# orm-help
g
what user does prisma use to generate a client on linux? meaning if you have
Copy code
user     group      permissions   folder
myUser   nogroup    drwx-r-xr-x    src
myUser   nogroup    drwx-r-xr-x    node_modules/prisma
myUser   nogroup    drwx-r-xr-x    node_modules/.prisma
myUser   nogroup    drwx-r-xr-x    node_modules/@prisma
the api I have is executed by the user: `myUser`on startup, and it also runs a separated script as a child process to run migrations from, but i get the error:
Copy code
Can't write to /application/node_modules/prisma please make sure you install "prisma" with the right permissions.
which makes me think I should add the
w
permission to prisma folders?
Copy code
RUN chmod -R o+w /application/node_modules/.prisma /application/node_modules/@prisma /application/node_modules/prisma
the script i'm using to run migrations looks like:
Copy code
const cmd1 = spawnSync('npx', ['prisma', 'generate', `--schema=${prismaSchema}`]);
    console.log('cmd1: ', cmd1.stdout.toString('utf8'), cmd1.stderr.toString('utf8'));

const cmd2 = spawnSync('npx', ['prisma', 'migrate', 'deploy', `--schema=${prismaSchema}`]);
    console.log('cmd2: ', cmd2.stdout.toString('utf8'), cmd2.stderr.toString('utf8'));
Could someone guide me here? ๐Ÿ˜… All of these is running in a ECS container, any help is highly appreciated ๐Ÿ™‚
โœ… 1
n
Hi Gustavo ๐Ÿ‘‹ It seems the current user doesnโ€™t have permission to write to
node_modules
Can you please give the current user permission to write to
node_modules
? Command:
chown <group/user>:<user> /path/to/node_modules
Alternatively, you could use a custom output path to specify a location to which the current user could write, this wonโ€™t require executing any command to change owner or modifying any permissions
โœ… 1
g
Hi @Nurul thanks for your answer, I was actually just coming to post the same solution, after some fresh air, I realised the user didn't have write access, so I gave it some, and it works now ๐Ÿ™‚ But will definitely check that doc you shared.
๐Ÿ™Œ 1
n
Glad to hear that