Cannot find module ‘fork-ts-checker-webpack-plugin-v5‘

用vue-clie脚手架搭建完vue3工程,执行npm run serve,会报一下错误。

Error: Cannot find module 'fork-ts-checker-webpack-plugin-v5'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
    at Function.Module._load (internal/modules/cjs/loader.js:507:25)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:22:18)
    at api.chainWebpack.config (E:\vueDemo\hello-world2\node_modules\@vue\cli-plugin-typescript\index.js:89:16)
    at webpackChainFns.forEach.fn (E:\vueDemo\hello-world2\node_modules\@vue\cli-service\lib\Service.js:236:40)
    at Array.forEach (<anonymous>)
    at Service.resolveChainableWebpackConfig (E:\vueDemo\hello-world2\node_modules\@vue\cli-service\lib\Service.js:236:26)
    at Service.resolveWebpackConfig (E:\vueDemo\hello-world2\node_modules\@vue\cli-service\lib\Service.js:240:48)
    at PluginAPI.resolveWebpackConfig (E:\vueDemo\hello-world2\node_modules\@vue\cli-service\lib\PluginAPI.js:132:25)
    at serve (E:\vueDemo\hello-world2\node_modules\@vue\cli-service\lib\commands\serve.js:75:31)
    at Service.run (E:\vueDemo\hello-world2\node_modules\@vue\cli-service\lib\Service.js:230:12)
    at Object.<anonymous> (E:\vueDemo\hello-world2\node_modules\@vue\cli-service\bin\vue-cli-service.js:36:9)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)

解决方案:

npm i fork-ts-checker-webpack-plugin,不要带后面-v5

猜想:可能作者在内部给fork-ts-checker-webpack-plugin起了个别名fork-ts-checker-webpack-plugin-v5,所以只需要安装fork-ts-checker-webpack-plugin即可

 

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值