i5ting / imove

INACTIVE: Move your mouse, generate code from flow chart
https://www.yuque.com/imove/docs/hvu0md
MIT License
3.75k stars 343 forks source link

npm i报错 #45

Closed lsby closed 3 years ago

lsby commented 3 years ago

环境

系统 image

node

$ node -v
v15.3.0

终端 git bash

现象

npm i报错

$ npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: root@undefined
npm ERR! Found: rollup@2.36.1
npm ERR! node_modules/rollup
npm ERR!   dev rollup@"^2.6.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer rollup@"^1.20.0" from @rollup/plugin-url@4.0.2
npm ERR! node_modules/@rollup/plugin-url
npm ERR!   dev @rollup/plugin-url@"^4.0.2" 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\hbyBy\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\hbyBy\AppData\Local\npm-cache\_logs\2021-01-11T09_36_10_347Z-debug.log
i5ting commented 3 years ago

收到,我们查一下

SmallStoneSK commented 3 years ago

@lsby

Fixed: dca816e3dcd894a845c7ebe260d726c3ae22379a

@rollup/plugin-url 4.0.2 版本的 peerDependency 对 rollup 有版本限制,与根目录的 rollup 版本冲突了。看了下目前项目中 @rollup/plugin-url 并没有起到作用,所以删除了 @rollup/plugin-url 依赖

lsby commented 3 years ago

@SmallStoneSK 然鹅在最新版本的提交(dca816e3dcd894a845c7ebe260d726c3ae22379a)上执行npm i 依然还有其他的对等依赖报错:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: root@undefined

npm ERR! Found: rollup@2.36.1
npm ERR! node_modules/rollup
npm ERR!   dev rollup@"^2.6.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer rollup@"^1.20.0" from rollup-plugin-size-snapshot@0.11.0
npm ERR! node_modules/rollup-plugin-size-snapshot
npm ERR!   dev rollup-plugin-size-snapshot@"^0.11.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\hbyBy\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\hbyBy\AppData\Local\npm-cache\_logs\2021-01-13T07_38_09_721Z-debug.log

即使把rollup-plugin-size-snapshot改为^0.12.0 还会有关于umi的对等依赖冲突qwq

npm WARN ERESOLVE overriding peer dependency
npm WARN Found: react@16.14.0
npm WARN node_modules/react  
npm WARN   react@"^16.13.1" from umi@3.3.4
npm WARN   node_modules/umi
npm WARN     dev umi@"^3.3.3" from the root project
npm WARN     3 more (dumi, @umijs/preset-dumi, @umijs/plugin-analytics)  
npm WARN   7 more (@umijs/runtime, dumi-theme-default, react-router, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"17.0.1" from react-dom@17.0.1
npm WARN node_modules/react-dom
npm WARN   peer react-dom@">=16.9.0" from rc-tabs@11.7.3
npm WARN   node_modules/rc-tabs
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: type-fest@0.11.0
npm ERR! node_modules/type-fest
npm ERR!   type-fest@"^0.11.0" from ansi-escapes@4.3.1       
npm ERR!   node_modules/ansi-escapes
npm ERR!     ansi-escapes@"^4.3.1" from marked-terminal@4.1.0
npm ERR!     node_modules/marked-terminal
npm ERR!       marked-terminal@"4.1.0" from @umijs/core@3.3.4
npm ERR!       node_modules/@umijs/core
npm ERR!         @umijs/core@"3.3.4" from umi@3.3.4
npm ERR!         node_modules/umi
npm ERR!         1 more (@umijs/types)
npm ERR!     ansi-escapes@"^4.2.1" from inquirer@7.3.3
npm ERR!     node_modules/inquirer
npm ERR!       inquirer@"^7.0.0" from eslint@6.8.0
npm ERR!       node_modules/eslint
npm ERR!         dev eslint@"^6.8.0" from the root project
npm ERR!         9 more (@typescript-eslint/eslint-plugin, ...)
npm ERR!     3 more (@jest/core, jest-watcher, terminal-link)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional type-fest@"^0.13.1" from @pmmmwh/react-refresh-webpack-plugin@0.4.3
npm ERR! node_modules/@pmmmwh/react-refresh-webpack-plugin
npm ERR!   @pmmmwh/react-refresh-webpack-plugin@"0.4.3" from @umijs/preset-built-in@3.3.4
npm ERR!   node_modules/@umijs/preset-built-in
npm ERR!     @umijs/preset-built-in@"3.3.4" from umi@3.3.4
npm ERR!     node_modules/umi
npm ERR!       dev umi@"^3.3.3" from the root project
npm ERR!       3 more (dumi, @umijs/preset-dumi, @umijs/plugin-analytics)
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\hbyBy\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\hbyBy\AppData\Local\npm-cache\_logs\2021-01-13T07_41_08_792Z-debug.log

文件日志如下

2021-01-13T07_41_08_792Z-debug.log eresolve-report.txt

SmallStoneSK commented 3 years ago

@lsby 看报错信息好像都是 peer-deps 的问题

npm install --legacy-peer-deps 

试一下呢?