[英]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.