修复上游依赖冲突安装 NPM 包
尝试 npm install vue-mapbox mapbox-gl 时出现依赖树错误.
Trying to npm install vue-mapbox mapbox-gl and I'm getting a dependency tree error.
我正在使用 Vuetify 运行 Nuxt SSR,并且在运行此安装并出现此错误之前没有安装任何与 Mapbox 相关的东西.
I'm running Nuxt SSR with Vuetify, and haven't installed anything related to Mapbox prior to running this install and getting this error.
38 error code ERESOLVE
39 error ERESOLVE unable to resolve dependency tree
40 error
41 error While resolving: [1mexample[22m@[1m1.0.0[22m
41 error Found: [1mmapbox-gl[22m@[1m1.13.0[22m[2m[22m
41 error [2mnode_modules/mapbox-gl[22m
41 error [1mmapbox-gl[22m@"[1m^1.13.0[22m" from the root project
41 error
41 error Could not resolve dependency:
41 error [35mpeer[39m [1mmapbox-gl[22m@"[1m^0.53.0[22m" from [1mvue-mapbox[22m@[1m0.4.1[22m[2m[22m
41 error [2mnode_modules/vue-mapbox[22m
41 error [1mvue-mapbox[22m@"[1m*[22m" from the root project
41 error
41 error Fix the upstream dependency conflict, or retry
41 error this command with --force, or --legacy-peer-deps
41 error to accept an incorrect (and potentially broken) dependency resolution.
41 error
41 error See /Users/user/.npm/eresolve-report.txt for a full report.
42 verbose exit 1
修复上游依赖冲突的正确方法是什么?
What's the right way to go about fixing this upstream dependency conflict?
看起来是最新版本的 npm (v7) 中 Peer Dependencies 的问题,它仍然是 beta 版本.尝试使用 npm install --legacy-peer-deps
了解详细信息,请查看 https://blog.npmjs.org/post/626173315965468672/npm-v7-series-beta-release-and-semver-major
Looks like it's a problem with Peer Dependencies in the latest version of npm (v7) which is still a beta version. try with npm install --legacy-peer-deps
for detail info check this https://blog.npmjs.org/post/626173315965468672/npm-v7-series-beta-release-and-semver-major