webpack安装处理css依赖,并解决 TypeError: this.getResolve is not a function的问题

问题描述

(node:10136) UnhandledPromiseRejectionWarning: TypeError: this.getResolve is not a function
at Object.loader (F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\css-loader\dist\index.js:62:27)
at LOADER_EXECUTION (F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\loader-runner\lib\LoaderRunner.js:119:14)
at runSyncOrAsync (F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\loader-runner\lib\LoaderRunner.js:120:4)
at iterateNormalLoaders (F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
at Array. (F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
at Storage.finished (F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:40:15)
at F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\enhanced-resolve\lib\CachedInputFileSystem.js:77:9
at F:\WebStorm\UseWebpack\03-webpack的loader使用\node_modules\graceful-fs\graceful-fs.js:123:16
at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
(node:10136) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function wit
hout a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:10136) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will
terminate the Node.js process with a non-zero exit code.

处理方法

一:修改css-loader中的版本问题,网上解决方法是把8.0版本修改为7.3,我这里把其修改为3.6.0就可以了。
在这里插入图片描述
二:运行npm install
三:运行npm run build 成功解决问题。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值