【发布时间】:2023-02-19 04:04:36
【问题描述】:
我无法从我的项目中使用 Prisma 为 supabase 数据库播种
我在 package.json 中添加了种子脚本
"prisma": {
"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed.ts"
},
在种子文件中 删除以前的记录然后创建许多条目。
await client.category.deleteMany();
const categories = await client.category.createMany({
data: [
{
name: "swimming",
},
],
});
但得到错误:
错误:命令是 被 SIGSEGV 杀死(分段错误):ts-node --compiler-options {“模块”:“CommonJS”} prisma/seed.ts
【问题讨论】:
-
我收到了那个错误,这就是我看到这篇文章的原因。但是 {\"module\":\"CommonJS\"} 与打字稿不兼容,对吗?