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

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.gif

node-sass这个模块很坑爹,一直报错安装不上,试了各种办法。

用了npm install 、cnpm install 、yarn install 都不行。

后来发现是node-sass模块对node版本有兼容性,版本不适配,就容易报错。

下图是node-sass和 node的对应的版本

node-sass模块 对于node版本.png
image.gif

如果切换node版本后,仍然报错,尝试重新构建下 node-sass模块

在项目目录下打开cmd:

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

image.gif

或者删除原先的node-pass,然后cnpm install node-pass 都可以

看下效果,运行顺利

image.png

<figcaption class="cke_widget_editable" contenteditable="true" data-cke-display-name="标题" data-cke-enter-mode="2" data-cke-filter="74" data-cke-widget-editable="caption">标题</figcaption>

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。