提示:这里描述项目中遇到的问题:
vscode安装stylus-loader失败报错
While resolving: gshop@1.0.0
npm ERR! Found: webpack@3.12.0
npm ERR! dev webpack@"^3.6.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack@"^4.0.0 || ^5.0.0" from stylus-loader@4.2.0
npm ERR! node_modules/stylus-loader
npm ERR! dev stylus-loader@"4.2.0" from the root project
---
# 原因分析:
> 提示安装的stylus-loader版本过高,安装失败,需要降低版本。
---
# 解决方案:
**安装低版本的stylus-loader
$ npm install stylus-loader@3.0.1 --save-dev**
PS E:\project\my-project\gshop> npm i stylus-loader@3.0.1 --save-dev
npm WARN idealTree Removing dependencies.stylus-loader in favor of devDependencies.stylus-loader
added 3 packages, and audited 1454 packages in 11s
68 packages are looking for funding
run `npm fund` for details
81 vulnerabilities (63 moderate, 18 high)
npm audit fix
To address all issues (including breaking changes), run:
npm audit fix --force
Run `npm audit` for details.
显示安装成功