方法一(这种没试)

报错信息:

Missing binding E:\webstorm\notepad\notepad\node_modules\node-sass\vendor\win32-x64-46\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 4.x

Found bindings for the following environments:
- Windows 64-bit with Node.js 6.x

This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to build the binding for your current environment.

@ ./~/vue-style-loader!./~/css-loader!./~/vue-loader/lib/style-rewriter.js?id=data-v-7931a4ec!./~/sass-loader!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/App.vue 4:14-240 13:2-17:4 14:20-246

 

解决方法:

  转自:http://blog.csdn.net/zhu1500527791/article/details/53444870

 

最近把Node从4.4.4升级到6.9.1版本,但是在执行npm i命令安装三方依赖包的时候出现了node-sass模块安装失败的问题。

erro

现在和大家分享下如何解决这个问题的方法

分析原因

erro

Cannot download "https://hithub.com/sass/node-sass/releases/download/v3.13.0/win32-x64-46_binding.node"
 
 
  • 1

从上图第九行代码可以看出,导致node-sass安装失败的原因是因为无法下载.node文件,解决办法就很简单了,就是我们把文件下载路径复制一份到浏览器里,然后使用浏览器下载文件就可以了。

具体方法

1.从node命令行中复制.node文件下载链接并在浏览器打开下载文件

https://github.com/sass/node-sass/releases/download/v3.13.0/win32-x64-46_binding.node
 
 
  • 1

2.文件下载成功后,在命令行工具输入下面指令:

set SASS_BINARY_PATH=D:/WorkCode/win32-x64-46_binding.node //PATH=后面是的下载的.node所在的路径
 
 
  • 1

设置SASS_BINARY_PATH环境变量,目的是告诉程序直接使用本地的.node文件,无需从网上下载

3.配置完成,从新输入指令:

npm i node-sass -D --verbose
 
 
  • 1

接下来你就会发现node-sass安装成功。


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

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

更多推荐