Module build failed (from ./node_modules/sass-loader/dist/cjs.js)

Module build failed (from ./node_modules/sass-loader/dist/cjs.js):

Error: Missing binding D:\www\xxx\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 Node.js 12.x

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.

这是几年前的项目,我的机子安的是nodejs v14.16.1,遇到这种情况,要么安装nodejs12的版本

要么可以npm uninstall sass-loader和npm uninstall node-sass,在安装npm install sass-loader 和node-sass

原因是sass-loader的版本问题,只适应相对的nodejs

注意安装最新的很有可能报错,起不来项目需要指定node-sass和sass-loader版本

目前我这边的项目用

cnpm i node-sass@4.14.1 cnpm i sass-loader@7.3.1 --save-dev 

如果你nodejs是其他版本,可能还会有变化

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容