node-sass编译安装
node-sass
:rainbow: Node.js bindings to libsass
项目地址:https://gitcode.com/gh_mirrors/no/node-sass
·
node-sass 是一个编译 sass 源文件为css 的nodejs 库,这是一个用C++ 写的底层库,在我们使用命令
npm install node-sass
安装的时候会使用 node-gyp 库去编译安装,这里我大概记录下安装流程和注意事项。
缘起:
在安装 node-sass 时报错,因为我本地装了vs2015,以前也安装了vs2017、vs2019,导致编译选项混乱而失败。
安装流程
安装 msbuild 编译工具(这里我推荐使用2017版 msbuild 编译工具)
去微软官网下载 MSBuild工具

选这个 Build Tools 就行,然后启动,工作负荷页选中两个


单个组件页里面页选中一些组件安装


选好之后下载安装好

注意配置
先执行命令 npm config list 查看环境

如果有 msbuild_path 就用以下命令删掉
npm config delete msbuild_path
然后执行命令
npm config set msvs_version=2017
设置编译时使用我们刚安装的2017版的 msbuild工具
安装 node-sass
npm install node-sass
一般安装好 msbuild 编译工具,设置好编译工具选项,到这一步都会成功。当然,其他问题也可能使编译安装不成功,这里只简单记录下我的安装经验。有时候也可以试试用 yarn。

: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> 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)