vue-element-plus-admin
vue-element-plus-admin copied to clipboard
不能运行
PS D:\code\github\vue-element-plus-admin> npm install npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: [email protected] npm ERR! Found: [email protected] npm ERR! node_modules/vue npm ERR! vue@"3.2.47" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer vue@"^2.6.14 || ^3.3.0" from [email protected] npm ERR! node_modules/pinia npm ERR! pinia@"^2.0.34" 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! npm ERR! For a full report see: npm ERR! C:\Users\Administrator\AppData\Local\npm-cache_logs\2023-05-30T16_12_49_367Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: C:\Users\Administrator\AppData\Local\npm-cache_logs\2023-05-30T16_12_49_367Z-debug-0.log
提示了一堆错误, npm install --force 安装成功了, 但是运行起来之后又报错了
PS D:\code\github\vue-element-plus-admin> npm install --force npm WARN using --force Recommended protections disabled. npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: [email protected] npm WARN Found: [email protected] npm WARN node_modules/vue npm WARN vue@"3.2.47" from the root project npm WARN 10 more (@vitejs/plugin-vue, @vitejs/plugin-vue-jsx, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer vue@"^2.6.14 || ^3.3.0" from [email protected] npm WARN node_modules/pinia npm WARN pinia@"^2.0.34" from the root project npm WARN npm WARN Conflicting peer dependency: [email protected] npm WARN node_modules/vue npm WARN peer vue@"^2.6.14 || ^3.3.0" from [email protected] npm WARN node_modules/pinia npm WARN pinia@"^2.0.34" from the root project npm WARN ERESOLVE overriding peer dependency npm WARN While resolving: [email protected] npm WARN Found: [email protected] npm WARN node_modules/stylelint npm WARN dev stylelint@"^15.4.0" from the root project npm WARN 4 more (stylelint-config-html, stylelint-config-recommended, ...) npm WARN npm WARN Could not resolve dependency: npm WARN peer stylelint@">= 11.x < 15" from [email protected] npm WARN node_modules/stylelint-config-prettier npm WARN dev stylelint-config-prettier@"^9.0.5" from the root project npm WARN npm WARN Conflicting peer dependency: [email protected] npm WARN node_modules/stylelint npm WARN peer stylelint@">= 11.x < 15" from [email protected] npm WARN node_modules/stylelint-config-prettier npm WARN dev stylelint-config-prettier@"^9.0.5" from the root project npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated npm WARN deprecated [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated [email protected]: Please use @jridgewell/sourcemap-codec instead npm WARN deprecated [email protected]: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
[email protected] prepare husky install
husky - Git hooks installed
added 1226 packages in 33s
执行 npm run dev , 打开localhost:4000 提示保错, 能帮我看看怎么运行起来项目吗?
PS D:\code\github\vue-element-plus-admin> npm run dev
[email protected] dev vite --mode base
00:13:53
VITE v4.2.1 ready in 3099 ms
➜ Local: http://localhost:4000/ 00:13:53 ➜ Network: http://192.168.6.1:4000/ 00:13:53 ➜ Network: http://192.168.80.1:4000/ 00:13:53 ➜ Network: http://192.168.0.109:4000/ 00:13:53 ➜ press h to show help 00:13:53 ✘ [ERROR] No matching export in "node_modules/pinia/node_modules/vue-demi/lib/index.mjs" for import "hasInjectionContext"
node_modules/pinia/dist/pinia.mjs:6:9:
6 │ import { hasInjectionContext, inject, toRaw, watch, unref, markRaw, effectScope, ref, isVue2, isRef, isRea...
╵ ~~~~~~~~~~~~~~~~~~~
D:\code\github\vue-element-plus-admin\node_modules\esbuild\lib\main.js:1636
let error = new Error(${text}${summary});
^
Error: Build failed with 1 error:
node_modules/pinia/dist/pinia.mjs:6:9: ERROR: No matching export in "node_modules/pinia/node_modules/vue-demi/lib/index.mjs" for import "hasInjectionContext"
at failureErrorWithLog (D:\code\github\vue-element-plus-admin\node_modules\esbuild\lib\main.js:1636:15)
at D:\code\github\vue-element-plus-admin\node_modules\esbuild\lib\main.js:1048:25
at runOnEndCallbacks (D:\code\github\vue-element-plus-admin\node_modules\esbuild\lib\main.js:1471:45)
at buildResponseToResult (D:\code\github\vue-element-plus-admin\node_modules\esbuild\lib\main.js:1046:7)
at D:\code\github\vue-element-plus-admin\node_modules\esbuild\lib\main.js:1058:9
at new Promise (
Node.js v18.16.0
pnpm安装,也是报这个错误 nodejs v16.15.0
Node v18 无法运行此项目
npm:check 升级依赖,就可以了
我也是一样的报错,跑不起来
node 20 运行完美
node 20 运行完美