Closed haseakito closed 10 months ago
When running seed script, it throws an error as below
seed
An error occurred while running the seed command: Error: Command failed with ENOENT: ts-node prisma/seed/start.ts spawn ts-node ENOENT
Also, the following is Nextjs related issue
Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
Follow the official documentation, and copy and paste the code below to package.json
package.json
"prisma": {"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed/start.ts"}
Issue
When running
seed
script, it throws an error as belowAlso, the following is Nextjs related issue
Fix
Follow the official documentation, and copy and paste the code below to
package.json
"prisma": {"seed": "ts-node --compiler-options {\"module\":\"CommonJS\"} prisma/seed/start.ts"}