因为没有node_modules依赖,我直接
1.npm install,但是报错:
在这里插入图片描述
2.npm install --force报错
3.npm audit fix --force报错
4.npm install --legacy-peer-deps报错
5.npm install --registry https://registry.npm.taobao.org 直接安装淘宝镜像也报错
6.npm node-sass@7.0.1 --legacy-peer-deps 报错
7.npm cache clean 或者 npm cache clean --force无用
8.最后采用办法1解决了

解决办法1:(我解决了)

  1. npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass

  2. npm install node-sass

解决办法2:(我尝试了,未解决)

  1. 删除package-lock.json和node_modules文件夹
  2. 在当前项目目录执行 npm install 或 cnpm install

其他办法3、4:(说什么版本问题之类的,未尝试)
node-sass@4.14.1的报错的最终解决方案

参考:
1.node-sass@4.14.1的报错的最终解决方案
2.npm install报错npm ERR Could not resolve dependency: npm ERR peer…
3.npm install:Could not resolve dependency:peer… 原因和解决方案
4.关于npm audit fix

GitHub 加速计划 / no / node-sass
8.5 K
1.33 K
下载
:rainbow: Node.js bindings to libsass
最近提交(Master分支:2 个月前 )
6081731a Bumps [actions/setup-node](https://github.com/actions/setup-node) from 3 to 4. - [Release notes](https://github.com/actions/setup-node/releases) - [Commits](https://github.com/actions/setup-node/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-node dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> 8 个月前
62c0f46c Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> 8 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐