【问题标题】:nestjs/cqrs - TypeError: Cannot read property 'values' of undefined on installnestjs/cqrs - 类型错误:安装时无法读取未定义的属性“值”
【发布时间】:2019-08-21 18:22:44
【问题描述】:

尝试使用@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"
  },

【问题讨论】:

    标签: javascript node.js typescript nestjs


    【解决方案1】:

    您为嵌套依赖项使用不同的主要版本(5 和 6)。由于存在重大更改,因此不能保证它们可以互操作。

    根据migration guide 将您的@nestjs 依赖项更新到v6,或者降级@nestjs/cqrs 包。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-04-29
      • 1970-01-01
      • 2021-10-30
      • 1970-01-01
      • 2021-12-03
      • 2021-11-22
      相关资源
      最近更新 更多