解決VUE-npm ERR! C:\rj\node-v14.4.0-win-x64\nod問題
VUE-npm ERR! C:\rj\node-v14.4.0-win-x64\nod
錯誤
解決辦法
- node -v 查看版本
- npm config set registry https://registry.npmmirror.com 設置下載源
- npm config get registry 獲取下載源
While resolving: vue-admin-template@3.8.0 npm ERR! Found: node-sass@6.0.1 npm ERR! node_modules/nod
npm install 報錯
While resolving: vue-admin-template@3.8.0
npm ERR! Found: node-sass@6.0.1
npm ERR! node_modules/node-sass
npm ERR! dev node-sass@"^6.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer node-sass@"^4.0.0" from sass-loader@6.0.7
npm ERR! node_modules/sass-loader
npm ERR! dev sass-loader@"6.0.7" 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 E:\node\node_cache\eresolve-report.txt for a full report.
解決辦法
我的node.js版本是16.18.1
在項目目的package.json文件把 node-sass 和 sass-loader 的修改成如下版本
- node-sass:^6.0.1
- sass-loader:^6.0.7
- 在命令后面加上:–legacy-peer-deps
npm install --legacy-peer-deps
總結
以上為個人經驗,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關文章
Vite+TS+Vue開啟eslint和prettier規(guī)范及校驗方式
這篇文章主要介紹了Vite+TS+Vue開啟eslint和prettier規(guī)范及校驗方式,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教2023-06-06Vue Element UI 表單自定義校驗規(guī)則及使用
這篇文章主要介紹了Vue Element UI 表單自定義效驗規(guī)則及使用,文中通過代碼介紹了常見表單效驗規(guī)則,代碼簡單易懂,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下2023-02-02crypto-js對稱加密解密的使用方式詳解(vue與java端)
這篇文章主要介紹了如何在Vue前端和Java后端使用crypto-js庫進行AES加密和解密,前端通過創(chuàng)建AES.js文件來實現加密解密功能,并在Vue文件或JavaScript中使用,后端則可以直接使用Java代碼進行AES加密和解密操作,需要的朋友可以參考下2025-01-01Vue3使用Univer Docs創(chuàng)建在線編輯Excel的示例代碼
本文介紹了如何在Vue3項目中集成UniverDocs,一個基于Luckysheet的企業(yè)文檔與數據協(xié)同解決方案,指導了從安裝到在頁面中使用的步驟,以及注意事項,如數據格式轉換和二次開發(fā)的靈活性,需要的朋友可以參考下2025-04-04import.meta.glob() 如何導入多個目錄下的資源(最新推薦)
import.meta.glob() 其實不僅能接收一個字符串,還可以接收一個字符串數組,就是匹配多個位置,本文給大家介紹import.meta.glob() 如何導入多個目錄下的資源,感興趣的朋友一起看看吧2023-11-11