Closed lihao29 closed 3 months ago
有安装 Taro for 鸿蒙插件吗?
$ npm i @tarojs/plugin-platform-harmony
有安装 Taro for 鸿蒙插件吗?
$ npm i @tarojs/plugin-platform-harmony
已安装,在node_module目录也已经有的:
解决了吗?同样的问题
目前验证只能用3.5.0老版本能成功:npm i -g @tarojs/cli@3.5.0-canary.0 插件也安装这个版本:npm install @tarojs/plugin-platform-harmony@3.5.0-canary.0 但是支持的鸿蒙API为6和7,更高就不行了。 不知道为啥taro现在3.6.4为啥有问题。
目前尝试taro相关版本号用 3.5.4-canary.1 可以编译成功,但是编译成功后文字不展示,不知道是什么问题
相关平台
鸿蒙
使用框架: Vue 3
复现步骤
https://taro-docs.jd.com/docs/harmony#5-%E7%BC%96%E8%AF%91%E8%BF%90%E8%A1%8C 参考官网支撑鸿蒙的描述,创建hello world工程,vue3,Sass,Webpack5,npm,CLI内置模板,在执行编译命令时报错。 提的讨论链接如下,目前问题还没有解决: https://github.com/NervJS/taro/discussions/13608
期望结果
执行鸿蒙编译命令正常,能够将编译结果打到hap里
实际结果
提示Error: 不存在编译平台 harmony
ReferenceError: path is not defined at Object. (C:\Users\lh\myApp0410b\config\index.js:57:18)
at Module._compile (node:internal/modules/cjs/loader:1191:14)
at Module._compile (C:\Users\lh\myApp0410b\node_modules\pirates\lib\index.js:136:24)
at Module._extensions..js (node:internal/modules/cjs/loader:1245:10)
at Object.newLoader [as .js] (C:\Users\lh\myApp0410b\node_modules\pirates\lib\index.js:141:7)
at Module.load (node:internal/modules/cjs/loader:1069:32)
at Function.Module._load (node:internal/modules/cjs/loader:904:12)
at Module.require (node:internal/modules/cjs/loader:1093:19)
at require (node:internal/modules/cjs/helpers:108:18)
at Config.init (C:\Users\lh\myApp0410b\node_modules\@tarojs\service\src\Config.ts:46:53)
C:\Users\lh\myApp0410b\node_modules\@tarojs\service\dist\Kernel.js:226
throw new Error(
不存在编译平台 ${platform}
); ^Error: 不存在编译平台 harmony at Kernel.runWithPlatform (C:\Users\lh\myApp0410b\node_modules\@tarojs\service\src\Kernel.ts:269:13) at Kernel. (C:\Users\lh\myApp0410b\node_modules\@tarojs\service\src\Kernel.ts:325:26)
at Generator.next ()
at fulfilled (C:\Users\lh\myApp0410b\node_modules\@tarojs\service\dist\Kernel.js:5:58)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
环境信息