最近让我维护一个三年前的项目,然后项目拉下来正常npm install发现会报如下错:

 node-sass@4.13.1 install D:\project\chengdu_bms_static\node_modules\node-sass
> node scripts/install.js

Downloading binary from https://npm.taobao.org/mirrors/node-sass/v4.13.1/win32-x64-83_binding.node
Cannot download "https://npm.taobao.org/mirrors/node-sass/v4.13.1/win32-x64-83_binding.node":

HTTP error 404 Not Found

可能是因为无法下载到node-sass和sass-loader,据说可能是版本不匹配,然后就开启我的踩坑之旅,折磨了我整整两天有余:

 附上解决方案,首先安装cnpm:

npm install -g cnpm -registry=https://registry.npm.taobao.org

安装成功cnpm -v查看版本:

 安装好后执行命令:

cnpm install

没有报sass错误了,说明已经安装好了,这个时候npm run dev执行,发现还有错误:

会报core.js报错,是由于版本太高了, 这个时候执行 cnpm install core-js@2,然后运行npm run dev,成功!!!!

 可真是个大冤种,花了两天时间,所幸,百度没有负我,希望这篇文章可以解决让有缘人看到,少踩坑......

 

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> 9 个月前
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> 9 个月前
Logo

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

更多推荐