Could not resolve dependency: npm ERR! peer vite@“^2.5.10” from @vitejs/plugin-vue@2.1.0
github中fork后:npm i
安装项目依赖时报错:
PS E:\download\vue-color-avatar-main> npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: vue-color-avatar@1.0.0
npm ERR! Found: vite@3.0.3
npm ERR! node_modules/vite
npm ERR! dev vite@"^3.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vite@"^2.5.10" from @vitejs/plugin-vue@2.1.0
npm ERR! dev @vitejs/plugin-vue@"^2.1.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\zhao\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\zhao\AppData\Local\npm-cache\_logs\2023-03-07T23_12_08_149Z-debug-0.log
报错中有提供解决方案:
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
使用:npm install --force
或npm install --legacy-peer-deps
问题:
在使用npm install --legacy-peer-deps
时,依旧报错:文章来源:https://www.toymoban.com/news/detail-627308.html
PS E:\download\vue-color-avatar-main> npm install --legacy-peer-deps
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated @volar/html2pug@0.31.2: WARNING: This project has been renamed to @johnsoncodehk/html2pug. Install using @johnsoncodehk/html2pug instead.
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated trim@0.0.1: Use String.prototype.trim() instead
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated vscode-pug-languageservice@0.31.2: WARNING: This project has been renamed to @volar/pug-language-service. Install using @volar/pug-language-service instead.
npm WARN deprecated vscode-typescript-languageservice@0.31.2: WARNING: This project has been renamed to @volar/typescript-language-service. Install using @volar/typescript-language-service instead.
npm WARN deprecated vscode-vue-languageservice@0.31.2: WARNING: This project has been renamed to @volar/vue-language-service. Install using @volar/vue-language-service instead.
npm ERR! Cannot read properties of null (reading 'pickAlgorithm')
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\zhao\AppData\Local\npm-cache\_logs\2023-03-07T23_16_16_126Z-debug-0.log
使用:npm install --force
,安装依赖包成功文章来源地址https://www.toymoban.com/news/detail-627308.html
PS E:\download\vue-color-avatar-main> npm i --force
npm WARN using --force Recommended protections disabled.
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: @vitejs/plugin-vue@2.1.0
npm WARN Found: vite@3.0.3
npm WARN node_modules/vite
npm WARN dev vite@"^3.0.3" from the root project
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer vite@"^2.5.10" from @vitejs/plugin-vue@2.1.0
npm WARN node_modules/@vitejs/plugin-vue
npm WARN dev @vitejs/plugin-vue@"^2.1.0" from the root project
npm WARN
npm WARN Conflicting peer dependency: vite@2.9.15
npm WARN node_modules/vite
npm WARN peer vite@"^2.5.10" from @vitejs/plugin-vue@2.1.0
npm WARN node_modules/@vitejs/plugin-vue
npm WARN dev @vitejs/plugin-vue@"^2.1.0" from the root project
npm WARN deprecated @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed.
npm WARN deprecated @volar/html2pug@0.31.2: WARNING: This project has been renamed to @johnsoncodehk/html2pug. Install using @johnsoncodehk/html2pug instead.
npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated trim@0.0.1: Use String.prototype.trim() instead
npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated sourcemap-codec@1.4.8: Please use @jridgewell/sourcemap-codec instead
npm WARN deprecated vscode-pug-languageservice@0.31.2: WARNING: This project has been renamed to @volar/pug-language-service. Install using @volar/pug-language-service instead.
npm WARN deprecated vscode-typescript-languageservice@0.31.2: WARNING: This project has been renamed to @volar/typescript-language-service. Install using @volar/typescript-language-service instead.
npm WARN deprecated vscode-vue-languageservice@0.31.2: WARNING: This project has been renamed to @volar/vue-language-service
到了这里,关于Could not resolve dependency: peer vite@“^2.5.10“ from @vitejs/plugin-vue@2.1.0的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!