尝试使用@nestjs/crqrs
软件包,但是启动npm install时出现以下错误:
(node:77) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'values' of undefined
api_1_305186ebcc50 | at modules.map.module (/var/www/node_modules/@nestjs/cqrs/dist/services/explorer.service.js:29:49)
(node:77) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
我不明白为什么,有什么主意吗?
这是我的依赖项:
"dependencies": {
"@nestjs/common": "^5.4.0",
"@nestjs/core": "^5.4.0",
"@nestjs/cqrs": "^6.0.0",
"@nestjs/swagger": "^2.5.1",
"bcrypt": "^3.0.5",
"class-validator": "^0.9.1",
"compression": "^1.7.4",
"helmet": "^3.16.0",
"pg": "^7.8.1",
"reflect-metadata": "^0.1.12",
"rxjs": "^6.2.2",
"shortid": "^2.2.14",
"typeorm": "^0.2.14",
"typescript": "^3.0.1"
},
"devDependencies": {
"@nestjs/testing": "^5.1.0",
"@types/express": "^4.16.0",
"@types/jest": "^23.3.1",
"@types/node": "^10.7.1",
"@types/supertest": "^2.0.5",
"jest": "^24.5.0",
"nodemon": "^1.18.3",
"prettier": "^1.14.2",
"supertest": "^3.1.0",
"ts-jest": "^23.1.3",
"ts-loader": "^4.4.2",
"ts-node": "^7.0.1",
"tsconfig-paths": "^3.5.0",
"tslint": "5.11.0"
},
答案 0 :(得分:0)
您为嵌套依赖项使用了不同的主要版本(5和6)。由于存在重大更改,因此不能保证它们可以互操作。
根据migration guide将@nestjs
依赖项更新为v6,或者降级@nestjs/cqrs
软件包。