node-sass模块报错安装不上?试试这个方法,亲测有效 | bug终结者

简介: 【bug终结者】每日解决一个小bug

node-sass 模块报错、老是安装不上?

Syntax Error: Error: Missing binding D:\code\xxxx\node_modules\node-sass\vendor\win32-x64-83\binding.node
Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 14.x

Found bindings for the following environments:
  - Windows 64-bit with Unsupported runtime (93)

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

image.png
node-sass这个模块很坑爹,一直报错安装不上,试了各种办法。
用了npm install 、cnpm install 、yarn install 都不行。
后来发现是node-sass模块对node版本有兼容性,版本不适配,就容易报错。
下图是node-sass和 node的对应的版本
image.pngimage.png编辑
如果切换node版本后,仍然报错,尝试重新构建下 node-sass模块
在项目目录下打开cmd:

输入命令: npm rebuild node-sass
然后再更新一下:npm update

或者删除原先的node-pass,然后cnpm install node-pass 都可以
看下效果,运行顺利
image.pngimage.png编辑

相关文章
|
17天前
|
缓存 JSON JavaScript
Node.js模块系统
Node.js模块系统
14 1
|
24天前
|
前端开发
windows10 安装node npm 等前端环境 并配置国内源
windows10 安装node npm 等前端环境 并配置国内源
42 3
|
1月前
|
移动开发 JavaScript 前端开发
为了学习vue3,安装nvm进行node的多版本管理
为了学习vue3,安装nvm进行node的多版本管理
83 2
|
1天前
|
Dart JavaScript 前端开发
npm install node-sass 安装失败的解决方案:利用国内镜像加速安装
npm install node-sass 安装失败的解决方案:利用国内镜像加速安装
9 1
|
3天前
|
JavaScript Linux
Linux安装nodejs
Linux安装nodejs
16 2
|
4天前
|
JavaScript Ubuntu Linux
蓝易云 - linux中安装nodejs,卸载nodejs,更新nodejs,git
请根据自己的Linux发行版和版本选择合适的命令。
12 2
|
12天前
|
JavaScript 应用服务中间件 Apache
Node.js Web 模块
Node.js Web 模块
13 2
|
1天前
|
运维 JavaScript Devops
阿里云云效操作报错合集之node.js构建时,报错:The build failed because the process exited too early.该怎么办
本合集将整理呈现用户在使用过程中遇到的报错及其对应的解决办法,包括但不限于账户权限设置错误、项目配置不正确、代码提交冲突、构建任务执行失败、测试环境异常、需求流转阻塞等问题。阿里云云效是一站式企业级研发协同和DevOps平台,为企业提供从需求规划、开发、测试、发布到运维、运营的全流程端到端服务和工具支撑,致力于提升企业的研发效能和创新能力。
|
2天前
|
JavaScript Linux
Linux安装nodejs指定版本
Linux安装nodejs指定版本
5 0
|
29天前
|
JavaScript 前端开发
基于 Node.js 环境,使用内置 http 模块,创建 Web 服务程序
基于 Node.js 环境,使用内置 http 模块,创建 Web 服务程序