Module build failed: TypeError: this.getResolve is not a function at Object.loader 安装node-sass运行报错
2020-01-12 10:42
746 查看
Module build failed: TypeError: this.getResolve is not a function at Object.loader 安装node-sass运行报错
安装node-sass编译报错
-
项目中,想使用sass的功能,当我们正常安装依赖时
默认会安装最新版
npm install node-sass sass-loader --save-dev //安装node-sass 安装sass-loader
-
安装完成后,运行时出现了错误
Modele build failed: TypeError: this.getResolve is not a function at Object.loader…
- 这是因为当前sass的版本太高,webpack编译时出现了错误,这个时候只需要换成低版本的就行
- 可以选择先删除安装的版本再安装指定版本,也可以直接安装指定版本会覆盖之前版本,安装后最好在package.json中确认其版本是不是安装的版本
// 卸载之前安装的版本 npm uninstall sass-loader --save-dev // 安装指定版本 npm install sass-loader@7.3.1 --save-dev
-
也可以直接在package.json中直接修改版本,然后重新安装项目依赖
"devDependencies": { "sass-loader": "^7.3.1", },
npm install
-
重新启动项目即可
- 点赞
- 收藏
- 分享
- 文章举报
相关文章推荐
- Angular引入node_modules里面的css文件出错Module build failed:TypeError:URL.startsWith is not a function
- 使用vue时Module build failed: TypeError: this._init is not a function错误的解决方法
- Module build failed: TypeError: this._init is not a function
- 【ReactJS 初体验】Module build failed: TypeError: fileSystem.statSync is not a function
- Uncaught TypeError: this.canvas.getContext is not a function
- React Uncaught TypeError: _react2.default.findDOMNode is not a function
- U-Net运行报错merge6 = merge([drop4,up6], mode = 'concat'...) TypeError: 'module' object is not callable
- chrome浏览器Uncaught TypeError: object is not a function问题解决
- node.js开发错误——TypeError: req.flash is not a function
- Error:Could not get unknown property ‘apkVariantData’ for object of type com.android.build.gradle.in
- React Uncaught TypeError: _react2.default.unmountComponentAtNode is not a functi
- Python包导入(TypeError: 'module' object is not callable),及一定要记住Python成员函数第一个参数值是self。
- [已解决]TypeError: 'module' object is not callable
- python TypeError: 'builtin_function_or_method' object is not iterable keys
- Uncaught TypeError: object is not a function
- 在用chrome调试JavaScript时,在console中出现“uncaught TypeError: Object is not a function”
- 使用jquery插件autocomplete时候出现typeerror:this.source is not a function即与jquery的autocomplete冲突
- Sea.js出现Uncaught TypeError: object is not a function的解决方法
- Uncaught TypeError: object is not a function
- python错误:TypeError: 'module' object is not callable