taro报错找不到@tarojs/plugin-platform-weapp“:

解决方案:打开packge.js看到当前的taro版本,以下必须版本一致

下载一致的@tarojs/plugin-platform-weapp

这里输入npm i @tarojs/plugin-platform-weapp@你的匹配版本,我的是3.5.8

然后修改project.config.json下的miniprogramRoot为dist/weapp/,否则会找不到app.json

解决:

如果你的任何一个taro依赖和别的依赖不一致会导致taro框架报错'type' of undifined!!切记,错误如下,出这个错就是文章开头那样去解决,改依赖版本!!

PS E:\JieZhangApp\jiezhang> npm install npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: jz-taro@4.0.0 npm ERR! Found: @tarojs/shared@4.1.7 npm ERR! node_modules/@tarojs/shared npm ERR! peer @tarojs/shared@"4.1.7" from @tarojs/plugin-platform-alipay@4.1.7 npm ERR! node_modules/@tarojs/plugin-platform-alipay npm ERR! peer @tarojs/plugin-platform-alipay@">=3" from taro-ui@3.3.0 npm ERR! node_modules/taro-ui npm ERR! taro-ui@"^3.3.0" from the root project npm ERR! @tarojs/shared@"4.1.7" from @tarojs/service@4.1.7 npm ERR! node_modules/@tarojs/service npm ERR! peer @tarojs/service@"4.1.7" from @tarojs/plugin-platform-alipay@4.1.7 npm ERR! node_modules/@tarojs/plugin-platform-alipay npm ERR! peer @tarojs/plugin-platform-alipay@">=3" from taro-ui@3.3.0 npm ERR! node_modules/taro-ui npm ERR! taro-ui@"^3.3.0" from the root project npm ERR! @tarojs/service@"4.1.7" from @tarojs/plugin-platform-h5@4.1.7 npm ERR! node_modules/@tarojs/plugin-platform-h5 npm ERR! peer @tarojs/plugin-platform-h5@">=3" from taro-ui@3.3.0 npm ERR! node_modules/taro-ui npm ERR! taro-ui@"^3.3.0" from the root project npm ERR! 3 more (@tarojs/plugin-platform-jd, ...) npm ERR! 5 more (@tarojs/plugin-platform-h5, ...) npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer @tarojs/shared@"~3.6.38" from @tarojs/plugin-platform-weapp@3.6.38 npm ERR! node_modules/@tarojs/plugin-platform-weapp npm ERR! @tarojs/plugin-platform-weapp@"3.6.38" from the root project npm ERR! peer @tarojs/plugin-platform-weapp@">=3" from taro-ui@3.3.0 npm ERR! node_modules/taro-ui npm ERR! taro-ui@"^3.3.0" from the root project npm ERR! npm ERR! Fix the upstream dependency conflict, or retry npm ERR! this command with --force or --legacy-peer-deps npm ERR! to accept an incorrect (and potentially broken) dependency resolution. npm ERR! npm ERR! npm ERR! For a full report see: npm ERR! E:\nodejs\node_cahe\_logs\2025-09-23T05_22_10_229Z-eresolve-report.txt npm ERR! A complete log of this run can be found in: E:\nodejs\node_cahe\_logs\2025-09-23T05_22_10_229Z-debug-0.log
09-24
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值