vue2老项目从mac还到windows环境跑不起来,npm无法安装
Author:zhoulujun Date:
今天把之前的老项目在windows跑了一下,发现跑步起来,报错内容如下
cli npm v9.6.6 does not support Node.js v15.14.0. This version of npm supports the following node versions: `^14.17.0 || ^16.13.0 || >=18.0.0`. You can find the latest version at https://nodejs.org/. npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! npm ERR! While resolving: @vue/[email protected] npm ERR! Found: [email protected] npm ERR! node_modules/vue npm ERR! vue@"^2.6.11" from the root project npm ERR! peer vue@"^2.5.22" from @cencent/[email protected] npm ERR! node_modules/@cencent/gem-bk-magic-vue npm ERR! @tencent/gem-bk-magic-vue@"^0.1.35" from the root project npm ERR! 14 more (@tinymce/tinymce-vue, @toast-ui/vue-editor, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer vue@"3.0.5" from @vue/[email protected] npm ERR! node_modules/@vue/compiler-sfc npm ERR! peerOptional @vue/compiler-sfc@"^3.0.0-beta.14" from @vue/[email protected] npm ERR! node_modules/@vue/cli-plugin-typescript npm ERR! dev @vue/cli-plugin-typescript@"~4.5.0" from the root project npm ERR! peerOptional @vue/compiler-sfc@"^3.0.0-beta.14" from @vue/[email protected] npm ERR! node_modules/@vue/cli-service npm ERR! dev @vue/cli-service@"~4.5.0" from the root project npm ERR! 7 more (@vue/cli-plugin-babel, @vue/cli-plugin-e2e-cypress, ...) npm ERR! 1 more (vue-codemod) npm ERR! npm ERR! node_modules/vue npm ERR! peer vue@"3.0.5" from @vue/[email protected] npm ERR! node_modules/@vue/compiler-sfc npm ERR! peerOptional @vue/compiler-sfc@"^3.0.0-beta.14" from @vue/[email protected] npm ERR! node_modules/@vue/cli-plugin-typescript npm ERR! peerOptional @vue/compiler-sfc@"^3.0.0-beta.14" from @vue/[email protected] npm ERR! dev @vue/cli-service@"~4.5.0" from the root project npm ERR! 1 more (vue-codemod) 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\zhoulujun\.tnpm\_logs\2023-05-09T08_33_03_791Z-eresolve-report.txt
刚刚开始以为是 nodejs版本的问题,因为本地nodejs 是20了,package.json 版本是
{ "name": "bk-zhoulujun", "version": "0.1.24", "private": true, "engines": { "node": "^v16.15.0", "npm": "^8.5.5" }, }
于是使用 nvm use 16.15.0 试一试,还是一样的。
谷哥搜了一下,也有这么说的,比如:webpackage依赖安装报错ERESOLVE unable to resolve dependency tree https://blog.csdn.net/qq_34137073/article/details/113646342
其是,只需
npm i --legacy-peer-deps
转载本站文章《vue2老项目从mac还到windows环境跑不起来,npm无法安装》,
请注明出处:https://www.zhoulujun.cn/html/webfront/ECMAScript/nodejs/8948.html