You may need an appropriate loader to handle this file type, currently no loaders are configured to

12 篇文章 0 订阅
4 篇文章 0 订阅

代码从git仓库拉的最新代码,下载node_module依赖包无法运行,以前已经下载的依赖包可以运行。

原因:

“@vueuse/head”: “^0.7.5”, 指的是 version 与version兼容 ,与2.3.1版本兼容,相当于2.X.X, 即>=2.3.1 < 3.0.0,不改变大版本号。

也就是说看着是0.7.5,但是有更新的话就会下载 大于0.7.5的版本

发现问题:

in ./node_modules/_@vueuse_head@0.7.9@@vueuse/head/dist/index.mjs

这种情况是将依赖包升级到了0.7.9版本导致的错误,锁死版本

这种问题在依赖包里找对应的依赖包:在 package.json 找 vueuse_head 相关的依赖包【“@vueuse/head”: “^0.7.5”,】,改成 【“@vueuse/head”: “0.7.5”,】将这个依赖包版本锁死,重新下载依赖包,解决

代码一样一个不能运行一个能运行,那就是先排差依赖包的版本问题了

运行错误

 ERROR  Failed to compile with 1 error                                                                                                                                                                      上午10:13:45

 error  in ./node_modules/_@vueuse_head@0.7.9@@vueuse/head/dist/index.mjs

Module parse failed: Unexpected token (126:41)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
|     return "";
|   if (typeof template === "string") {
>     return template.replace("%s", title ?? "");
|   }
|   return template(unref(title));

 @ ./library/setup.js 12:0-42 15:12-22
 @ ./src/main.js
 @ multi ./node_modules/_webpack-dev-server@3.11.3@webpack-dev-server/client?http://192.168.0.235:9528&sockPath=/sockjs-node (webpack)/hot/dev-server.js ./src/main.js

错误效果图
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值