Tejas H
04/10/2022, 8:28 AMnpx prisma migrate reset --force
/ npx prisma db seed
, it gives me the following error. No idea what to do. Been searching for a solution. Please help.Tejas H
04/10/2022, 8:28 AMTejas H
04/10/2022, 8:30 AMimport { users } from "./seeds/users";
import { PrismaClient } from '@prisma/client';
const prisma = new PrismaClient();
async function main() {
for (let user of users) {
await prisma.user.create({
data: {
...user,
},
});
}
}
main().catch((e) => {
console.log(e, "error")
process.exit(1)
}).finally(async () => {
await prisma.$disconnect();
});
Tejas H
04/10/2022, 8:31 AMconst users = [
{
firstName: 'John',
lastName: 'Doe',
userName: 'johndoe',
avatar: '<https://avatars0.githubusercontent.com/u/17098?v=4>',
authLevel: 'L4'
}
]
export { users }
janpio
ts-node
installed in your app? Can you just execute ts-node
?
You might need to replace the command with npx ts-node
if you do not have a global install.janpio