我的代码中出现此错误
Typerror:ProjectRepository不是构造函数 主要是.....
这是main.js中的代码
const Promise = require('bluebird')
const AppDAO = require('./dao')
const ProjectRepository = require('./project_repository')
const TaskRepository = require('./task_repository')
function main() {
const dao = new AppDAO('./database.sqlite3')
const blogProjectData = {name: 'Write Node.js - SQLite Tutorial'}
const projectRepo = new ProjectRepository(dao)
const taskRepo = new TaskRepository(dao)
let projectId
这是带有构造函数的project_repository.js类
class ProjectRepository{
constructor(dao){
this.dao = dao
}
这很简单,但是我不知道为什么它会失败。