记录下vue中vite版本的问题

 以下是报错信息:

0 verbose cli D:\A_software\node.js\node.exe D:\A_software\node.js\node_global\node_modules\npm\bin\npm-cli.js
1 info using npm@10.8.2
2 info using node@v20.11.1
3 silly config load:file:D:\A_software\node.js\node_global\node_modules\npm\npmrc
4 silly config load:file:D:\A_CODE\VUE\naive-ui-admin-main\.npmrc
5 silly config load:file:C:\Users\46807\.npmrc
6 silly config load:file:D:\A_software\node.js\node_global\etc\npmrc
7 verbose title npm install @types/vite
8 verbose argv "install" "@types/vite" "--save-dev"
9 verbose logfile logs-max:10 dir:D:\A_software\node.js\node_cache\_logs\2024-08-15T06_35_37_823Z-
10 verbose logfile D:\A_software\node.js\node_cache\_logs\2024-08-15T06_35_37_823Z-debug-0.log
11 silly packumentCache heap:4345298944 maxSize:1086324736 maxEntrySize:543162368
12 silly logfile start cleaning logs, removing 2 files
13 silly logfile done cleaning log files
14 silly idealTree buildDeps
15 silly fetch manifest @vicons/antd@^0.12.0
16 silly packumentCache full:https://registry.npmjs.org/@vicons%2fantd cache-miss
17 http fetch GET https://registry.npmjs.org/@vicons%2fantd attempt 1 failed with ECONNRESET
18 http fetch GET https://registry.npmjs.org/@vicons%2fantd attempt 2 failed with ECONNRESET
19 http fetch GET https://registry.npmjs.org/@vicons%2fantd attempt 3 failed with ECONNRESET
20 silly fetch manifest @vicons/ionicons5@^0.12.0
21 silly packumentCache full:https://registry.npmjs.org/@vicons%2fionicons5 cache-miss
22 http fetch GET 200 https://registry.npmjs.org/@vicons%2fionicons5 4929ms (cache miss)
23 silly packumentCache full:https://registry.npmjs.org/@vicons%2fionicons5 set size:undefined disposed:false
24 silly fetch manifest @vueup/vue-quill@^1.2.0
25 silly packumentCache full:https://registry.npmjs.org/@vueup%2fvue-quill cache-miss
26 http fetch GET 200 https://registry.npmjs.org/@vueup%2fvue-quill 594ms (cache miss)
27 silly packumentCache full:https://registry.npmjs.org/@vueup%2fvue-quill set size:undefined disposed:false
28 silly fetch manifest vue@^3.4.31
29 silly packumentCache full:https://registry.npmjs.org/vue cache-miss
30 http fetch GET 200 https://registry.npmjs.org/vue 300ms (cache revalidated)
31 silly packumentCache full:https://registry.npmjs.org/vue set size:1837866 disposed:false
32 silly fetch manifest typescript@^4.9.5
33 silly packumentCache full:https://registry.npmjs.org/typescript cache-miss
34 http fetch GET 200 https://registry.npmjs.org/typescript 301ms (cache revalidated)
35 silly packumentCache full:https://registry.npmjs.org/typescript set size:13106500 disposed:false
36 silly fetch manifest @vueuse/core@^9.13.0
37 silly packumentCache full:https://registry.npmjs.org/@vueuse%2fcore cache-miss
38 http fetch GET 200 https://registry.npmjs.org/@vueuse%2fcore 869ms (cache revalidated)
39 silly packumentCache full:https://registry.npmjs.org/@vueuse%2fcore set size:1050677 disposed:false
40 silly fetch manifest axios@^1.7.2
41 silly packumentCache full:https://registry.npmjs.org/axios cache-miss
42 http fetch GET 200 https://registry.npmjs.org/axios 280ms (cache revalidated)
43 silly packumentCache full:https://registry.npmjs.org/axios set size:560291 disposed:false
44 silly fetch manifest blueimp-md5@^2.19.0
45 silly packumentCache full:https://registry.npmjs.org/blueimp-md5 cache-miss
46 http fetch GET 200 https://registry.npmjs.org/blueimp-md5 298ms (cache revalidated)
47 silly packumentCache full:https://registry.npmjs.org/blueimp-md5 set size:73301 disposed:false
48 silly fetch manifest date-fns@^2.30.0
49 silly packumentCache full:https://registry.npmjs.org/date-fns cache-miss
50 http fetch GET 200 https://registry.npmjs.org/date-fns 306ms (cache revalidated)
51 silly packumentCache full:https://registry.npmjs.org/date-fns set size:2969124 disposed:false
52 silly fetch manifest echarts@^5.5.1
53 silly packumentCache full:https://registry.npmjs.org/echarts cache-miss
54 http fetch GET 200 https://registry.npmjs.org/echarts 266ms (cache revalidated)
55 silly packumentCache full:https://registry.npmjs.org/echarts set size:466423 disposed:false
56 silly fetch manifest element-resize-detector@^1.2.4
57 silly packumentCache full:https://registry.npmjs.org/element-resize-detector cache-miss
58 http fetch GET 200 https://registry.npmjs.org/element-resize-detector 268ms (cache revalidated)
59 silly packumentCache full:https://registry.npmjs.org/element-resize-detector set size:94083 disposed:false
60 silly fetch manifest lodash-es@^4.17.21
61 silly packumentCache full:https://registry.npmjs.org/lodash-es cache-miss
62 http fetch GET 200 https://registry.npmjs.org/lodash-es 302ms (cache revalidated)
63 silly packumentCache full:https://registry.npmjs.org/lodash-es set size:135180 disposed:false
64 silly fetch manifest mitt@^3.0.1
65 silly packumentCache full:https://registry.npmjs.org/mitt cache-miss
66 http fetch GET 200 https://registry.npmjs.org/mitt 728ms (cache revalidated)
67 silly packumentCache full:https://registry.npmjs.org/mitt set size:61450 disposed:false
68 silly fetch manifest mockjs@^1.1.0
69 silly packumentCache full:https://registry.npmjs.org/mockjs cache-miss
70 http fetch GET 200 https://registry.npmjs.org/mockjs 277ms (cache revalidated)
71 silly packumentCache full:https://registry.npmjs.org/mockjs set size:21766 disposed:false
72 silly fetch manifest naive-ui@^2.38.2
73 silly packumentCache full:https://registry.npmjs.org/naive-ui cache-miss
74 http fetch GET 200 https://registry.npmjs.org/naive-ui 415ms (cache revalidated)
75 silly packumentCache full:https://registry.npmjs.org/naive-ui set size:928435 disposed:false
76 silly fetch manifest pinia@^2.1.7
77 silly packumentCache full:https://registry.npmjs.org/pinia cache-miss
78 http fetch GET 200 https://registry.npmjs.org/pinia 287ms (cache revalidated)
79 silly packumentCache full:https://registry.npmjs.org/pinia set size:507922 disposed:false
80 silly fetch manifest @vue/composition-api@^1.4.0
81 silly packumentCache full:https://registry.npmjs.org/@vue%2fcomposition-api cache-miss
82 http fetch GET 200 https://registry.npmjs.org/@vue%2fcomposition-api 279ms (cache revalidated)
83 silly packumentCache full:https://registry.npmjs.org/@vue%2fcomposition-api set size:679956 disposed:false
84 silly fetch manifest vue@>= 2.5 < 2.7
85 silly packumentCache full:https://registry.npmjs.org/vue cache-miss
86 http fetch GET 200 https://registry.npmjs.org/vue 30ms (cache hit)
87 silly packumentCache full:https://registry.npmjs.org/vue set size:1837866 disposed:false
88 silly fetch manifest qs@^6.12.1
89 silly packumentCache full:https://registry.npmjs.org/qs cache-miss
90 http fetch GET 200 https://registry.npmjs.org/qs 311ms (cache revalidated)
91 silly packumentCache full:https://registry.npmjs.org/qs set size:256693 disposed:false
92 silly fetch manifest vfonts@^0.0.3
93 silly packumentCache full:https://registry.npmjs.org/vfonts cache-miss
94 http fetch GET 200 https://registry.npmjs.org/vfonts 304ms (cache revalidated)
95 silly packumentCache full:https://registry.npmjs.org/vfonts set size:8590 disposed:false
96 silly fetch manifest vue-router@^4.4.0
97 silly packumentCache full:https://registry.npmjs.org/vue-router cache-miss
98 http fetch GET 200 https://registry.npmjs.org/vue-router 294ms (cache revalidated)
99 silly packumentCache full:https://registry.npmjs.org/vue-router set size:868859 disposed:false
100 silly fetch manifest vue-types@^4.2.1
101 silly packumentCache full:https://registry.npmjs.org/vue-types cache-miss
102 http fetch GET 200 https://registry.npmjs.org/vue-types 235ms (cache revalidated)
103 silly packumentCache full:https://registry.npmjs.org/vue-types set size:608727 disposed:false
104 silly fetch manifest @commitlint/cli@^17.8.1
105 silly packumentCache full:https://registry.npmjs.org/@commitlint%2fcli cache-miss
106 http fetch GET 200 https://registry.npmjs.org/@commitlint%2fcli 326ms (cache revalidated)
107 silly packumentCache full:https://registry.npmjs.org/@commitlint%2fcli set size:383505 disposed:false
108 silly fetch manifest @commitlint/config-conventional@^17.8.1
109 silly packumentCache full:https://registry.npmjs.org/@commitlint%2fconfig-conventional cache-miss
110 http fetch GET 200 https://registry.npmjs.org/@commitlint%2fconfig-conventional 343ms (cache revalidated)
111 silly packumentCache full:https://registry.npmjs.org/@commitlint%2fconfig-conventional set size:264039 disposed:false
112 silly fetch manifest @types/lodash@^4.17.6
113 silly packumentCache full:https://registry.npmjs.org/@types%2flodash cache-miss
114 http fetch GET 200 https://registry.npmjs.org/@types%2flodash 314ms (cache revalidated)
115 silly packumentCache full:https://registry.npmjs.org/@types%2flodash set size:457434 disposed:false
116 silly fetch manifest @types/node@^18.19.39
117 silly packumentCache full:https://registry.npmjs.org/@types%2fnode cache-miss
118 http fetch GET 200 https://registry.npmjs.org/@types%2fnode 279ms (cache revalidated)
119 silly packumentCache full:https://registry.npmjs.org/@types%2fnode set size:8937156 disposed:false
120 silly fetch manifest @typescript-eslint/eslint-plugin@^5.62.0
121 silly packumentCache full:https://registry.npmjs.org/@typescript-eslint%2feslint-plugin cache-miss
122 http fetch GET 200 https://registry.npmjs.org/@typescript-eslint%2feslint-plugin 3295ms (cache updated)
123 silly packumentCache full:https://registry.npmjs.org/@typescript-eslint%2feslint-plugin set size:undefined disposed:false
124 silly fetch manifest @typescript-eslint/parser@^5.62.0
125 silly packumentCache full:https://registry.npmjs.org/@typescript-eslint%2fparser cache-miss
126 http fetch GET 200 https://registry.npmjs.org/@typescript-eslint%2fparser 1567ms (cache updated)
127 silly packumentCache full:https://registry.npmjs.org/@typescript-eslint%2fparser set size:undefined disposed:false
128 silly fetch manifest eslint@^8.57.0
129 silly packumentCache full:https://registry.npmjs.org/eslint cache-miss
130 http fetch GET 200 https://registry.npmjs.org/eslint 347ms (cache revalidated)
131 silly packumentCache full:https://registry.npmjs.org/eslint set size:1581128 disposed:false
132 silly fetch manifest @vitejs/plugin-vue@^3.2.0
133 silly packumentCache full:https://registry.npmjs.org/@vitejs%2fplugin-vue cache-miss
134 http fetch GET 200 https://registry.npmjs.org/@vitejs%2fplugin-vue 292ms (cache revalidated)
135 silly packumentCache full:https://registry.npmjs.org/@vitejs%2fplugin-vue set size:371655 disposed:false
136 silly fetch manifest vite@^5.3.2
137 silly packumentCache full:https://registry.npmjs.org/vite cache-miss
138 http fetch GET 200 https://registry.npmjs.org/vite 369ms (cache revalidated)
139 silly packumentCache full:https://registry.npmjs.org/vite set size:37905612 disposed:false
140 silly fetch manifest vite@^3.0.0
141 silly packumentCache full:https://registry.npmjs.org/vite cache-miss
142 http fetch GET 200 https://registry.npmjs.org/vite 82ms (cache hit)
143 silly packumentCache full:https://registry.npmjs.org/vite set size:37905612 disposed:false
144 silly fetch manifest less@^4.2.0
145 silly packumentCache full:https://registry.npmjs.org/less cache-miss
146 http fetch GET 200 https://registry.npmjs.org/less 283ms (cache revalidated)
147 silly packumentCache full:https://registry.npmjs.org/less set size:437766 disposed:false
148 silly fetch manifest lightningcss@^1.21.0
149 silly packumentCache full:https://registry.npmjs.org/lightningcss cache-miss
150 http fetch GET 200 https://registry.npmjs.org/lightningcss 305ms (cache revalidated)
151 silly packumentCache full:https://registry.npmjs.org/lightningcss set size:126737 disposed:false
152 silly fetch manifest sass@*
153 silly packumentCache full:https://registry.npmjs.org/sass cache-miss
154 http fetch GET 200 https://registry.npmjs.org/sass 300ms (cache revalidated)
155 silly packumentCache full:https://registry.npmjs.org/sass set size:616271 disposed:false
156 silly fetch manifest sass-embedded@*
157 silly packumentCache full:https://registry.npmjs.org/sass-embedded cache-miss
158 http fetch GET 200 https://registry.npmjs.org/sass-embedded 272ms (cache revalidated)
159 silly packumentCache full:https://registry.npmjs.org/sass-embedded set size:223659 disposed:false
160 silly fetch manifest stylus@*
161 silly packumentCache full:https://registry.npmjs.org/stylus cache-miss
162 http fetch GET 200 https://registry.npmjs.org/stylus 242ms (cache revalidated)
163 silly packumentCache full:https://registry.npmjs.org/stylus set size:294182 disposed:false
164 silly fetch manifest sugarss@*
165 silly packumentCache full:https://registry.npmjs.org/sugarss cache-miss
166 http fetch GET 200 https://registry.npmjs.org/sugarss 298ms (cache revalidated)
167 silly packumentCache full:https://registry.npmjs.org/sugarss set size:48015 disposed:false
168 silly fetch manifest postcss@^8.4.38
169 silly packumentCache full:https://registry.npmjs.org/postcss cache-miss
170 http fetch GET 200 https://registry.npmjs.org/postcss 309ms (cache revalidated)
171 silly packumentCache full:https://registry.npmjs.org/postcss set size:651245 disposed:false
172 silly fetch manifest terser@^5.4.0
173 silly packumentCache full:https://registry.npmjs.org/terser cache-miss
174 http fetch GET 200 https://registry.npmjs.org/terser 268ms (cache revalidated)
175 silly packumentCache full:https://registry.npmjs.org/terser set size:715515 disposed:false
176 verbose stack Error: unable to resolve dependency tree
176 verbose stack     at #failPeerConflict (D:\A_software\node.js\node_global\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1360:25)
176 verbose stack     at #loadPeerSet (D:\A_software\node.js\node_global\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:1326:33)
176 verbose stack     at async #buildDepStep (D:\A_software\node.js\node_global\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:901:11)
176 verbose stack     at async Arborist.buildIdealTree (D:\A_software\node.js\node_global\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\build-ideal-tree.js:181:7)
176 verbose stack     at async Promise.all (index 1)
176 verbose stack     at async Arborist.reify (D:\A_software\node.js\node_global\node_modules\npm\node_modules\@npmcli\arborist\lib\arborist\reify.js:131:5)
176 verbose stack     at async Install.exec (D:\A_software\node.js\node_global\node_modules\npm\lib\commands\install.js:150:5)
176 verbose stack     at async Npm.exec (D:\A_software\node.js\node_global\node_modules\npm\lib\npm.js:207:9)
176 verbose stack     at async module.exports (D:\A_software\node.js\node_global\node_modules\npm\lib\cli\entry.js:74:5)
177 error code ERESOLVE
178 error ERESOLVE unable to resolve dependency tree
179 error
180 error While resolving: naive-ui-admin@1.9.3
180 error Found: vite@5.4.0[2m[22m
180 error [2mnode_modules/vite[22m
180 error   [34mdev[39m vite@"^5.3.2" from the root project
180 error
180 error Could not resolve dependency:
180 error [95mpeer[39m vite@"^3.0.0" from @vitejs/plugin-vue@3.2.0[2m[22m
180 error [2mnode_modules/@vitejs/plugin-vue[22m
180 error   [34mdev[39m @vitejs/plugin-vue@"^3.2.0" from the root project
180 error
180 error Fix the upstream dependency conflict, or retry
180 error this command with --force or --legacy-peer-deps
180 error to accept an incorrect (and potentially broken) dependency resolution.
181 error
181 error
181 error For a full report see:
181 error D:\A_software\node.js\node_cache\_logs\2024-08-15T06_35_37_823Z-eresolve-report.txt
182 silly unfinished npm timer reify 1723703738617
183 silly unfinished npm timer reify:loadTrees 1723703738625
184 silly unfinished npm timer idealTree:buildDeps 1723703738637
185 silly unfinished npm timer idealTree:#root 1723703738637
186 verbose cwd D:\A_CODE\VUE\naive-ui-admin-main
187 verbose os Windows_NT 10.0.22631
188 verbose node v20.11.1
189 verbose npm  v10.8.2
190 verbose exit 1
191 verbose code 1
192 error A complete log of this run can be found in: D:\A_software\node.js\node_cache\_logs\2024-08-15T06_35_37_823Z-debug-0.log

 这看起来是在安装依赖时出现了依赖版本冲突的问题。 错误信息指出 `@vitejs/plugin-vue@3.2.0` 期望的 `vite` 版本是 `^3.0.0` ,但您项目中已有的 `vite@5.4.0` 不符合要求。 您可以尝试按照错误提示中的建议,使用以下命令之一来解决:

1. `npm install --force`:强制安装,可能会导致一些潜在的问题,但有时能解决依赖冲突。

2. `npm install --legacy-peer-deps`:以传统的方式处理对等依赖,这可能会忽略一些严格的依赖版本要求。 在执行这些命令之前,请确保您了解可能带来的影响,并最好先备份您的项目。

除了前面提到的使用 `--force` 或 `--legacy-peer-deps` 选项外,还可以尝试以下方法来解决版本冲突问题:

1. 检查项目文档和相关配置:确认项目所依赖的各个包的正确版本要求,并相应地调整您的 `package.json` 中的版本约束。

2. 手动调整依赖版本:在 `package.json` 中,将 `vite` 和 `@vitejs/plugin-vue` 的版本约束修改为相互兼容的版本。您可以查看这两个包的文档或相关项目示例来确定合适的版本。

3. 清理并重新安装依赖: 先删除 `node_modules` 文件夹和 `package-lock.json`(如果使用 NPM)或 `yarn.lock`(如果使用 Yarn)。 然后重新运行安装命令 `npm install` 或 `yarn install` 。 4. 如果可能的话,升级或降级项目中其他相关依赖,以使其与 `vite` 和 `@vitejs/plugin-vue` 的版本兼容。

5. 查看社区和相关论坛:搜索是否有其他人遇到类似的版本冲突问题,并参考他们的解决方案。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值