基本前提:了解版本对应关系

示例:

  我的nodejs:v14.21.3,

则package.json:

  "node-sass": "^4.14.1",

  "sass-loader": "^8.0.0",

扩展:
查看node历史版本:

Node.js历史版本下载页面(中文版)

查看node-sass历史版本:

node-sass - npm

查看sass-loader历史版本:

sass-loader - npm

跑项目:(重点步骤)

1.删除node_modules文件夹,刚拉的项目如果没有就不用删
2.删除package-lock.json、yarn.lock文件

3.参考上述版本关系,修改package.json文件

    "node-sass": "^4.14.1",
    "sass-loader": "^8.0.0",

4.更换npm镜像源:(不用yarn)

①查看当前源地址:npm config get registry

②修改成(最新)淘宝镜像地址:npm config set registry https://registry.npmmirror.com

5.清理npm缓存

npm cache clean --force

6.安装依赖:

npm install

7.运行

npm run serve

GitHub 加速计划 / no / node-sass
8.5 K
1.33 K
下载
:rainbow: Node.js bindings to libsass
最近提交(Master分支:23 天前 )
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> 7 个月前
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> 7 个月前
Logo

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

更多推荐