node-sass第三方下载,本地安装
node-sass
:rainbow: Node.js bindings to libsass
项目地址:https://gitcode.com/gh_mirrors/no/node-sass
·
问题
- 尤其是在windows平台上,使用npm会经常发现node-sass无法安装,原因如下
安装 node-sass 时在 node scripts/install 阶段会从 github.com 上下载一个 .node 文件。大部分安装不成功的原因都源自这里,因为 github Releases 里的文件都托管在 s3.amazonaws.com 上面,而这个网址在国内总是网络不稳定,所以我们需要通过第三方服务器下载这个文件.
镜像源切换
- 一个有意思的工具包
nrm,它可以很方便切换源
npm install -g nrm
nrm ls // 查看所有镜像源列表
nrm use taobao // 局部设置为taobao镜像源
第三方下载
- 下载的地址,可从报错信息中获取,通常可以从如下红线区获取

- 然后通过迅雷等工具新建任务下载
配置.npmrc
.npmrc文件在~家目录下,windows在c/users/用户名(登录主机用户名)下,没有新建一个即可- 主要是配置
sass_binary_path这一选项,将地址指向下载的文件路径即可 - 示例配置如下
registry=https://registry.npm.taobao.org/
prefix=D:\repository\npm_global_modules\npm
cache=D:\repository\npm_global_modules\npm-cache
strict-ssl=false
home=https://npm.taobao.org
phantomjs_cdnurl=http://cnpmjs.org/downloads
sass_binary_path=D:\repository\comm\win32-x64-64_binding.node
:rainbow: Node.js bindings to libsass
最近提交(Master分支:4 个月前 )
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> 1 年前
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> 1 年前
AtomGit 是由开放原子开源基金会联合 CSDN 等生态伙伴共同推出的新一代开源与人工智能协作平台。平台坚持“开放、中立、公益”的理念,把代码托管、模型共享、数据集托管、智能体开发体验和算力服务整合在一起,为开发者提供从开发、训练到部署的一站式体验。
更多推荐



所有评论(0)