我正在尝试在我的 express 应用中使用 Prisma.js。但我在模块导入时出错。我不确定我哪里出错了。
'use strict';
var sql = require('../connection.js');
import { PrismaClient } from '@prisma/client';
//const prisma = new PrismaClient()
class InvoiceService {
constructor(){
}
getInvoices(body,query,user){
return new Promise(function (resolve, reject) {
resolve(query);
});
}
}
module.exports = {InvoiceService};
答案 0 :(得分:1)
将导入更改为:
const { PrismaClient } = require('@prisma/client');
它会正常工作。