記錄一個離譜的編譯錯誤。
克隆vue-admin-beautiful項目,master分支可以正常拉取,vue3.0-antdv編譯報下面的錯誤。
嘗試一:
$ cnpm install
Install fail! Error: GET https://registry.npmmirror.com/vab-config response 451 status
Error: GET https://registry.npmmirror.com/vab-config response 451 status
嘗試二:
$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: vue-admin-beautiful-antdv@1.0.0
npm ERR! Found: eslint@7.32.0
npm ERR! node_modules/eslint npm ERR! dev eslint@"^7.30.0" from the root project npm ERR!
npm ERR! Could not resolve dependency: npm ERR! peer eslint@">= 1.6.0 < 7.0.0" from @vue/cli-plugin-eslint@4.5.19 npm ERR! node_modules/@vue/cli-plugin-eslint
有錯誤說是npm版本問題,npm7在編譯的時候會更加嚴(yán)格。我換成npm6和npm8都不行。并嘗試了多個版本的npm替代包——cnpm、pnpm。
最終的解決方案是
1、npm源換成騰訊源(taobao的地址都install不了?,試試可以更換其他的registry源地址。)
?npm config set registry http://mirrors.cloud.tencent.com/npm/
2、然后這個編譯命令
npm install --legacy-peer-deps
3、啟動 npm run serve --fix
文章來源:http://www.zghlxwxcb.cn/news/detail-401315.html
?文章來源地址http://www.zghlxwxcb.cn/news/detail-401315.html
到了這里,關(guān)于vue-admin-beautiful:npm ERR! code ERESOLVE && npm ERR! code E451的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!