odule not found: Error: Can't resolve 'less-loader' in 'C:\data\project\front-web\vue\day-03\05-脚手架相关代码\demo1'
时间: 2023-08-14 07:05:34 浏览: 120
根据你提供的引用内容,你在写Vue项目时遇到了一个错误,错误信息是"Module not found: Error: Can't resolve 'less-loader' in 'E:\NodeDemo\vue_assistant_lsp'"。解决这个问题的方法是添加依赖并进行相应的配置。首先,你需要通过运行命令"npm install --save-dev less-loader less"来添加依赖。然后,你需要打开webpack.base.conf.js文件,在其中添加以下配置:
```
{
test: /\.less$/,
loader: "style-loader!css-loader!less-loader",
}
```
如果你遇到了"npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree"这种报错,可能是因为你的npm版本太高。你可以参考这篇文章进行具体操作:https://blog.csdn.net/weixin_38345306/article/details/118700876。希望这些信息能够帮助你解决问题。\[1\]\[2\]\[3\]
#### 引用[.reference_title]
- *1* [Module not found: Error: Can't resolve 'less-loader' in 'E:\NodeDemo\vue_assistant_lsp'](https://blog.csdn.net/qq_43290288/article/details/105405583)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* *3* [vue项目报错Module not found: Error: Can‘t resolve ‘less-loader‘ in。。。。](https://blog.csdn.net/weixin_38345306/article/details/118699650)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文