我在使用tsc构建时遇到此错误
从'sequelize-typescript'导入{Sequelize};
类型'typeof Sequelize'上不存在属性'Op'。
52 [Sequelize.Op.not]:否~~
我的包json
"dependencies": {
"bcrypt": "^3.0.2",
"bluebird": "^3.5.1",
"body-parser": "^1.18.2",
"dotenv": "^6.2.0",
"express": "^4.16.2",
"express-statsd": "^0.3.0",
"express-validator": "^5.3.0",
"hashids": "^1.2.2",
"jsonwebtoken": "^8.4.0",
"mailgun-js": "^0.22.0",
"mysql2": "^1.5.1",
"nyc": "^13.1.0",
"reflect-metadata": "^0.1.10",
"sequelize": "^5.21.7",
"sequelize-typescript": "^1.1.0",
"strong-error-handler": "^2.3.0",
"supertest": "^3.3.0",
"uuid": "^3.3.2"
},
"devDependencies": {
"@types/express": "^4.0.39",
"@types/mocha": "2.2.41",
"@types/node": "^13.13.4",
"mocha": "^5.2.0",
"ts-node": "^8.4.1",
"tslint": "^5.8.0",
"typescript": "^3.8.3"
}
有人可以帮忙吗?提前谢谢!!
整个“ sequelize-typescript”源文件中没有符号Op
。也许您是说SequelizeOptions
?将来,请查看源(在node_modules
中)。或再次查看文档。
尝试使用此导入
import {Op} from "sequelize";
...
{[Op.eq]: false}