Nuxt 和 vuex-persist:npm 错误!代码 ERESOLVE
安装 npm install --save vuex-persist
后使用 npm up
时出现以下错误,这个包和我的配置有什么问题?
我正在使用 Nuxt ^2.15.8
。
❯ npm up
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/vue
npm ERR! peer vue@"*" from @nuxtjs/[email protected]
npm ERR! node_modules/@nuxtjs/auth-next
npm ERR! @nuxtjs/auth-next@"5.0.0-1643791578.532b3d6" from the root project
npm ERR! peer vue@"^2.6.4" from [email protected]
npm ERR! node_modules/vuetify
npm ERR! vuetify@"^2.6.3" from the root project
npm ERR! vuetify@"^2.6" from @nuxtjs/[email protected]
npm ERR! node_modules/@nuxtjs/vuetify
npm ERR! dev @nuxtjs/vuetify@"^1.12.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! vuex-persist@"^3.1.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/vue
npm ERR! peer vue@"^3.0.2" from [email protected]
npm ERR! node_modules/vuex
npm ERR! peer vuex@">=2.5" from [email protected]
npm ERR! node_modules/vuex-persist
npm ERR! vuex-persist@"^3.1.3" 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 /Users/me/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/me/.npm/_logs/2022-02-28T11_06_47_549Z-debug-0.log
这个问题可以这样重现:
npm init nuxt-app foo
cd foo
npm install --save vuex-persist
npm up
I'm getting the following error when using npm up
after installing npm install --save vuex-persist
, what's wrong with this package and my configuration?
I'm using Nuxt ^2.15.8
.
❯ npm up
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/vue
npm ERR! peer vue@"*" from @nuxtjs/[email protected]
npm ERR! node_modules/@nuxtjs/auth-next
npm ERR! @nuxtjs/auth-next@"5.0.0-1643791578.532b3d6" from the root project
npm ERR! peer vue@"^2.6.4" from [email protected]
npm ERR! node_modules/vuetify
npm ERR! vuetify@"^2.6.3" from the root project
npm ERR! vuetify@"^2.6" from @nuxtjs/[email protected]
npm ERR! node_modules/@nuxtjs/vuetify
npm ERR! dev @nuxtjs/vuetify@"^1.12.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! vuex-persist@"^3.1.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/vue
npm ERR! peer vue@"^3.0.2" from [email protected]
npm ERR! node_modules/vuex
npm ERR! peer vuex@">=2.5" from [email protected]
npm ERR! node_modules/vuex-persist
npm ERR! vuex-persist@"^3.1.3" 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 /Users/me/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/me/.npm/_logs/2022-02-28T11_06_47_549Z-debug-0.log
This issue can be reproducted this way:
npm init nuxt-app foo
cd foo
npm install --save vuex-persist
npm up
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我最终通过在
package.json
中设置"vuex": "<4"
修复了它:I finally fixed it by setting
"vuex": "<4"
in mypackage.json
: