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

2024-04-22 22:38

本文主要是介绍Module build failed (from ./node_modules/_sass-loader@12.3.0@sass-loader/dist/cjs.js): TypeError:,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

报错

Module build failed (from ./node_modules/_sass-loader@12.3.0@sass-loader/dist/cjs.js):
TypeError: this.getOptions is not a function
at Object.loader (/Users/apple/Desktop/vue/hotspot_admin/node_modules/_sass-loader@12.3.0@sass-loader/dist/index.js:25:24)
@ ./node_modules/vue-style-loader??ref–8-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref–8-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref–8-oneOf-1-2!./node_modules/_sass-loader@12.3.0@sass-loader/dist/cjs.js??ref–8-oneOf-1-3!./node_modules/cache-loader/dist/cjs.js??ref–0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/Tinymce/components/preView.vue?vue&type=style&index=1&id=1a4f87c2&lang=scss&scoped=true& 4:14-518 14:3-18:5 15:22-526

无论是npm install还是cnpm install 下载的node_modules都不能使用。即使运行项目,也无法启动项目。

我找了许多方式来解决此问题,包括:
第一种:

npm install node-sass --save 重新装下node-sass

npm install -g cnpm --registry=https://registry.npm.taobao.org下载cnpm
然后用cnpm去安装 cnpm install node-sass --save

第二种:

  1. 先运行: npm install -g node-gyp
  2. 然后运行:运行 npm install --global --production windows-build-tools
可以自动安装跨平台的编译器npm uninstall node-sass
npm i node-sass --sass_binary_site=https://npm.taobao.org/mirrors/node-sass/

等等以上方法,运行时已就报错。我差点去下载python了。

第三种:
因为之前运行项目都没有出问题,所以我怀疑是自己更新了node最新版本导致的。
于是删除了本地的node版本(我使用的是14.15.0),使用了别人的旧版本号 node 12.18.0.结果还是不行。

正解:

不绕弯子了,我终于发现了一个很沙雕的问题,居然是node-sass sass-loader 版本不匹配。直接更改成相同版本就运行正常了。

解决方法:

cnpm install node-sass@7.0.1
npm install sass-loader@7.0.1

运行这两行代码就能成功运行了。(ps:浪费了我一下午的时间,搞这个,呜呜呜)

这篇关于Module build failed (from ./node_modules/_sass-loader@12.3.0@sass-loader/dist/cjs.js): TypeError:的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/927064

相关文章

js+css二级导航

效果 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Con

js小题:通过字符串执行同名变量怎么做

在JavaScript中,你不能直接使用一个字符串来直接引用一个变量,因为JavaScript是一种静态类型语言(尽管它的类型在运行时可以变化),变量的名字在编译时就被确定了。但是,有几种方法可以实现类似的功能: 使用对象(或Map)来存储变量: 你可以使用一个对象来存储你的变量,然后使用字符串作为键来访问这些变量。 let myVars = { 'var1': 'Hello', 'var

SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED]

python 在使用websocket 或者request可能会报这个错误,这是证书认证中的错误,如果不是对安全要求高的开发,可以使用下面的方式使request与websocket正常访问   在request中修改一个参数即可正常使用: textmod = {     "ID": "T214",      "Longitude": 123.6355038767646,      "Lati

图形编辑器基于Paper.js教程03:认识Paper.js中的所有类

先来认一下Paper的资源对象,小弟有哪些,有个整体的认识。认个脸。 在Paper.js的 官方文档中类大致有如下这些: 基类: ProjectViewItemPointToolSizeSegmentRectangleCurveCurveLocationMatrixColorStyleTweenToolEventGradientGradientStopEvent 二级或三级类 继承Ite

HTML文档插入JS代码的几种方法

在HTML文档里嵌入客户端JavaScript代码有4中方法: 1.内联,放置在< script>和标签对之间。 2.放置在由< script>标签的src属性指定的外部文件中。 3.放置在HTML事件处理程序中,该事件处理程序由onclick或onmouseover这样的HTML属性值指定。 4.放在一个URL里,这个URL使用特殊的“javascript:”协议。 在JS编程中,主张

nginx 8051#0: *4 recv() failed (104: Connection reset by peer) while reading response header from u

环境    php7   nginx1.8.0    nginx   报错  500  GATWAY网关错误 2017/08/28 10:45:42 [error] 7975#0: *333 recv() failed (104: Connection reset by peer) while reading response header from upstream, clien

js 正则表达式出现问题

帮同事写个页面,出现正则表达式不管怎么改都没法匹配的情况。。。。 reg = /^sy[0-9]+$/i; if(rtx.match(reg) == null){ alert("请输入正确的RTX账号!"); return false; } 因为之前一直用的是 reg ="/^sy[0-9]+$/i"; 写PHP写习惯了。。外面多写了两个双引号……T.T 改

bootstrap和JS相关

下表列出了模态框中要用到事件。这些事件可在函数中当钩子使用。 bootstrap 显示隐藏div $('.show-info').click(function () {var show = $(this).data('show');if(show =='all'){$('#creative').show();$('#plan').show();$('#plan').attr('class','

文件权限修改为777,php failed to open stream: Permission denied

记录一次在谷歌云上的异常诡异的事件: 环境 centos7.5 nginx php7.0 mysql 问题: 问题一 我用相同的nginx配置,只是修改了nginx root目录。 打开/var/www/html/ 这个目录就报 2018/06/22 04:35:03 [error] 15840#0: *438 FastCGI sent in stderr: “Primary scr

sublime配置node.js

1、下载Nodejs插件,下载地址为: https://github.com/tanepiper/SublimeText-Nodejs(见本人网盘) 下载zip压缩包后解压,文件名改为Nodejs 2、打开Sublime Text3,点击菜单“Perferences” =>“Browse Packages”打开“Packages”文件夹,并将第1部的Nodejs文件夹剪切进来 3