简体   繁体   English

为什么我在安装 typeorm 时收到错误消息?

[英]Why i receive error message while install typeorm?

I tried to build my project with Jenkins.我试图用 Jenkins 构建我的项目。

Node version: 16.16.0节点版本:16.16.0

Npm version: 8.11.0 npm 版本:8.11.0

Env: Ubuntu 20.04.4 LTS环境:Ubuntu 20.04.4 LTS

Jenkins pulled git repo and tried to install dependencies. Jenkins 拉了 git repo 并尝试安装依赖项。 I installed nodejs plugin to jenkins.我将nodejs插件安装到jenkins。

If i tried run npm i manually from /var/lib/jenkins/workspace it shows me same error log.如果我尝试从 /var/lib/jenkins/workspace 手动运行 npm,它会显示相同的错误日志。

npm i working correctly on my local machine (Windows 10) Also i tried to re-install node and npm with versions from my local machine, but nothing happened :( npm 我在我的本地机器上正常工作(Windows 10)我还尝试使用本地机器上的版本重新安装 node 和 npm,但什么也没发生 :(

My error log:我的错误日志:

00:07:51 npm ERR! code ERESOLVE
00:07:51 npm ERR! ERESOLVE could not resolve
00:07:51 npm ERR! 
00:07:51 npm ERR! While resolving: @nestjs/typeorm@8.0.3
00:07:51 npm ERR! Found: typeorm@0.3.6
00:07:51 npm ERR! node_modules/typeorm
00:07:51 npm ERR!   typeorm@"^0.3.6" from the root project
00:07:51 npm ERR! 
00:07:51 npm ERR! Could not resolve dependency:
00:07:51 npm ERR! peer typeorm@"^0.2.34" from @nestjs/typeorm@8.0.3
00:07:51 npm ERR! node_modules/@nestjs/typeorm
00:07:51 npm ERR!   @nestjs/typeorm@"^8.0.3" from the root project
00:07:51 npm ERR! 
00:07:51 npm ERR! Conflicting peer dependency: typeorm@0.2.45
00:07:51 npm ERR! node_modules/typeorm
00:07:51 npm ERR!   peer typeorm@"^0.2.34" from @nestjs/typeorm@8.0.3
00:07:51 npm ERR!   node_modules/@nestjs/typeorm
00:07:51 npm ERR!     @nestjs/typeorm@"^8.0.3" from the root project
00:07:51 npm ERR! 
00:07:51 npm ERR! Fix the upstream dependency conflict, or retry
00:07:51 npm ERR! this command with --force, or --legacy-peer-deps
00:07:51 npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
00:07:51 npm ERR! 
00:07:51 npm ERR! See /var/lib/jenkins/.npm/eresolve-report.txt for a full report.
00:07:51 
00:07:51 npm ERR! A complete log of this run can be found in:
00:07:51 npm ERR!     /var/lib/jenkins/.npm/_logs/2022-07-20T21_07_43_903Z-debug-0.log

package.json file: package.json 文件:

{
  "name": "teach-me-grow",
  "version": "0.0.1",
  "description": "",
  "author": "",
  "private": true,
  "license": "UNLICENSED",
  "scripts": {
    "prebuild": "rimraf dist",
    "build": "nest build",
    "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
    "start": "nest start",
    "start:dev": "nest start --watch",
    "start:debug": "nest start --debug --watch",
    "start:prod": "node dist/main",
    "lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
    "test": "jest",
    "test:watch": "jest --watch",
    "test:cov": "jest --coverage",
    "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
    "test:e2e": "jest --config ./test/jest-e2e.json"
  },
  "dependencies": {
    "@nestjs/common": "^8.0.0",
    "@nestjs/core": "^8.0.0",
    "@nestjs/passport": "^8.2.1",
    "@nestjs/platform-express": "^8.0.0",
    "@nestjs/swagger": "^5.2.1",
    "@nestjs/typeorm": "^8.0.3",
    "class-validator": "^0.13.2",
    "connect-typeorm": "^1.1.4",
    "dotenv": "^16.0.1",
    "express-session": "^1.17.3",
    "module-alias": "^2.2.2",
    "passport": "^0.5.3",
    "passport-facebook": "^3.0.0",
    "passport-google-oauth20": "^2.0.0",
    "passport-local": "^1.0.0",
    "pg": "^8.7.3",
    "pg-hstore": "^2.3.4",
    "reflect-metadata": "^0.1.13",
    "rimraf": "^3.0.2",
    "rxjs": "^7.2.0",
    "swagger-ui-express": "^4.4.0",
    "typeorm": "^0.3.6"
  },
  "devDependencies": {
    "@nestjs/cli": "^8.0.0",
    "@nestjs/schematics": "^8.0.0",
    "@nestjs/testing": "^8.0.0",
    "@types/express": "^4.17.13",
    "@types/jest": "27.5.0",
    "@types/node": "^16.0.0",
    "@types/supertest": "^2.0.11",
    "@typescript-eslint/eslint-plugin": "^5.0.0",
    "@typescript-eslint/parser": "^5.0.0",
    "eslint": "^8.0.1",
    "eslint-config-prettier": "^8.3.0",
    "eslint-plugin-prettier": "^4.0.0",
    "jest": "28.0.3",
    "prettier": "^2.3.2",
    "source-map-support": "^0.5.20",
    "supertest": "^6.1.3",
    "ts-jest": "28.0.1",
    "ts-loader": "^9.2.3",
    "ts-node": "^10.0.0",
    "tsconfig-paths": "4.0.0",
    "typescript": "^4.3.5"
  },
  "jest": {
    "moduleFileExtensions": [
      "js",
      "json",
      "ts"
    ],
    "rootDir": "src",
    "testRegex": ".*\\.spec\\.ts$",
    "transform": {
      "^.+\\.(t|j)s$": "ts-jest"
    },
    "collectCoverageFrom": [
      "**/*.(t|j)s"
    ],
    "coverageDirectory": "../coverage",
    "testEnvironment": "node"
  },
  "_moduleAliases": {
    "@app": "./dist"
  }
}

查看版本 8.0.3 中的nestjs/typeorm它在其依赖项中有固定版本的typeorm包(package.json: https ://github.com/nestjs/typeorm/blob/8.0.3/package.json)如果你想要坚持使用nestjs/typeorm 8.0.3 版本将您的typeorm版本降低到0.2.45 或将nestjs/typeorm版本升级到使用较新typeorm版本的版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我尝试安装express-generator,但收到奇怪的错误消息 - I try to install express-generator, but I receive a curious error message 为什么我收到此API请求的错误? - Why do I receive an error with this API request? TypeORM 连接失败,没有任何错误信息 - TypeORM fails to connect without any error message 在AWS上的while循环中接收和删除消息 - receive and delete message in a while loop on aws 当我尝试安装 nodemon 时出现此错误消息 - When I try to install nodemon i get this error message 为什么我收到错误:TypeError: Cannot read property of 'split' of undefined - Why I receive error: TypeError: Cannot read property of 'split' of undefined 为什么升级feathersjs后我收到错误:MethodNotAllowed - Why after upgrade feathersjs I receive error: MethodNotAllowed 如何处理 NestJS 中的 TypeORM 错误? - How can I handle TypeORM error in NestJS? 为什么我收到此错误消息:“在console.developers.google.com中创建API密钥时,“未找到此API项目” - Why I get this error message:'This API project was not found'while I'd created API key in console.developers.google.com 为什么 sanity cli 在安装时会出错? - Why does sanity cli get error while install it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM