실행
npm install vue-router --save
에러
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: navtest@0.1.0
npm ERR! Found: vue@2.7.16
npm ERR! node_modules/vue
npm ERR! vue@"^2.7.16" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue@"^3.2.0" from vue-router@4.3.1
npm ERR! node_modules/vue-router
npm ERR! vue-router@"*" 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\okha4\AppData\Local\npm-cache\_logs\2024-04-17T10_28_35_801Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: C:\Users\okha4\AppData\Local\npm-cache\_logs\2024-04-17T10_28_35_801Z-debug-0.log
* 1차 *
검색을 하니 npm version과 vue router 간의 문제라고 하여. npm 버전을 확인해보았습니다.
npm 10.2.4 버전 너무 최신인 듯 합니다.ㅜㅜ
1. npm 버전 변경
npm install -g npm@6.14.8
2. router 재 설치
npm install vue-router --save
에러
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@3. I'll try to do my best with it!
npm WARN deprecated @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
npm WARN deprecated webpack-chain@6.5.1: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/@vue%2fvue-loader-v15 - Not found
npm ERR! 404
npm ERR! 404 '@vue/vue-loader-v15@15.11.1' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of '@vue/cli-service'
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\okha4\AppData\Roaming\npm-cache\_logs\2024-04-17T10_44_41_959Z-debug.log
이번에는 다른에러...ㅜㅜ
검색하니 아래와 같이 하면 되다고하여 실행 하였습니다.
npm i --legacy-peer-deps
드디어!!!
* 해결 *
vue2 router 설치 어렵네요.ㅠㅠ
npm버전 잘 확인해 보세요.