
Node-Sass.zip
5星
- 浏览量: 0
- 大小:None
- 文件类型:None
简介:
Node-Sass是一个用于将Sass编译成CSS的Node.js绑定库。它提供了强大的脚本功能和快速高效的Sass解析能力。
遇到 failed Error: not found: python2 node-sass 错误提示如下:
```npm WARN prefer global node-gyp@3.6.0 should be installed with -g > node-sass@4.5.2 install E:\workspace_vscode\ww\node_modules\node-sass > node scripts/install.js Downloading binary from https://github.com/sass/node-sass/releases/download/v4.5 .2/win32-x64-48_binding.node Cannot download https://github.com/sass/node-sass/releases/download/v4.5.2/win3 2-x64-48_binding.node: connect ETIMEDOUT 54.231.72.83:443 Timed out whilst downloading the prebuilt binary gyp verb check python checking for Python executable python2 in the PATH gyp verb `which` failed Error: not found: python2```
此问题有两套解决方案:
**方案一:安装Python环境**
根据提示,需要一个有效的Python2环境。如果已存在合适的Python环境但未自动配置,则可能需手动调整系统变量以确保兼容性。
```npm install --global --production windows-build-tools```
**方案二:下载资源文件**
由于网络问题导致无法访问GitHub上的特定链接,可以尝试直接从其他渠道获取所需的 `win32-x64-48_binding.node` 文件。一旦获得该文件后,可以通过设置环境变量来指定其路径。
```set SASS_BINARY_PATH=D:\nodejs\tools\node-sass\win32-x64-46_binding.node```
以上任一方案执行成功之后再运行 `npm install` 命令即可解决上述问题。
全部评论 (0)


