- 发布:2024-02-18 10:59
- 更新:2024-09-05 19:47
- 阅读:869
【报Bug】cli创建的vue2 uniapp项目使用 uni-upgrade-center 后,编译app自定义基座时报错
产品分类: uni-app x/App
PC开发环境操作系统: Mac
PC开发环境操作系统版本号: 14.4
HBuilderX版本号: 4.05
手机系统: 全部
测试过的手机:
操作步骤:
点击hubuilder云发布
点击hubuilder云发布
预期结果:
编译成功
编译成功
实际结果:
编译失败 报错
编译失败 报错
bug描述:
操作系统为mac的m1平台,无法安装@dcloudio/uts-darwin-x64插件。
[HBuilder] 10:52:09.424 Module build failed (from ./node_modules/@dcloudio/uni-cli-shared/lib/uts/uts-loader.js):
[HBuilder] 10:52:09.424 Error: Cannot find module '@dcloudio/uts-darwin-x64'
[HBuilder] 10:52:09.999 at GetAddrInfoReqWrap.onlookup [as oncomplete] (node:dns:109:26) {
[HBuilder] 10:52:10.015 errno: -3008,
[HBuilder] 10:52:10.015 code: 'ENOTFOUND',
[HBuilder] 10:52:10.030 syscall: 'getaddrinfo',
[HBuilder] 10:52:10.045 hostname: '96f0e031-f37a-48ef-84c7-2023f6360c0a.bspapp.com'
[HBuilder] 10:52:10.057 }
9 个回复
删库在逃程序员
哈哈哈
依赖就算了,为啥依赖的包不是arm64而是x64
我已经不升级很久了,结果插件乱搞。
现在官方插件都不想用了
升级HBX堪比西天取经
DCloud_UNI_LXH
这个报错你跑什么项目应该都会报错,你把真机运行(uni-app x)的插件删除,然后重新安装一下试试看
Fixon (作者)
尝试了删掉uni-upgrade-center,就打包成功,引入uni-upgrade-center就报错Error: Cannot find module '@dcloudio/uts-darwin-x64',这个包有arm版本的吗
2024-03-21 16:49
Fixon (作者)
Hbuilder(4.05)和uni-upgrade-center都升级到最新的版本了
2024-03-21 16:50
Fixon (作者)
执行yarn add @dcloudio/uts-darwin-x64,报错 @dcloudio/uts-darwin-x64@3.0.0-alpha-3040820220424005: The CPU architecture "arm64" is incompatible with this module.
2024-03-21 16:52
DCloud_UNI_LXH
回复 Fixon: 你是用的 hx 吗?
uni-app(Vue3)编译
这个插件删除重装一下,再装一下uts 开发扩展
这些插件。重新运行试试2024-03-22 15:57
Fixon (作者)
回复 DCloud_UNI_LXH: 嗯嗯,是hbuilderX,跟着你说的操作了一遍还是报错,我把HbuilderX卸载了重装还是报错
2024-03-22 17:21
Fixon (作者)
跑APP本地基座和云打包都会报这个错
[HBuilder] 10:52:09.424 Module build failed (from ./node_modules/@dcloudio/uni-cli-shared/lib/uts/uts-loader.js):
[HBuilder] 10:52:09.424 Error: Cannot find module '@dcloudio/uts-darwin-x64'
2024-03-22 19:53
Fixon (作者)
回复 DCloud_UNI_LXH: 有没有处理办法呀,现在没办法使用mac打包调试uni-upgrade-center
2024-03-26 10:50
DCloud_UNI_LXH
回复 Fixon: 如果是标准基座是否报错?
2024-03-26 10:53
Fixon (作者)
回复 DCloud_UNI_LXH: 也是报错,错误是一样的
2024-03-26 11:11
Fixon (作者)
回复 DCloud_UNI_LXH: 请问下有没有Mac发布的方法呀
2024-03-27 15:46
Fixon (作者)
回复 DCloud_UNI_LXH: 升级到4.0.6还是没办法打包
2024-03-27 19:29
Fixon (作者)
这里是完整的错误日志,在MacBook Pro M1 macOS14系统下点击打包就会报这个错。
[HBuilder] 16:47:52.285 Module build failed (from ./node_modules/@dcloudio/uni-cli-shared/lib/uts/uts-loader.js):
[HBuilder] 16:47:52.285 Error: Cannot find module '@dcloudio/uts-darwin-x64'
[HBuilder] 16:47:52.290 Require stack:
[HBuilder] 16:47:52.291 - /Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uts/dist/binding.js
[HBuilder] 16:47:52.297 - /Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uts/dist/api.js
[HBuilder] 16:47:52.322 - /Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uts/dist/index.js
[HBuilder] 16:47:52.323 - /Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uni-uts-v1/dist/code.js
[HBuilder] 16:47:52.329 - /Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uni-uts-v1/dist/index.js
[HBuilder] 16:47:52.335 - /Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uni-cli-shared/lib/uts/uts.js
[HBuilder] 16:47:52.336 - /Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uni-cli-shared/lib/uts/resolver.js
[HBuilder] 16:47:52.347 - /Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uni-cli-shared/lib/uts/index.js
[HBuilder] 16:47:52.353 - /Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uni-cli-shared/lib/index.js
[HBuilder] 16:47:52.358 - /Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/vue-cli-plugin-uni/lib/env.js
[HBuilder] 16:47:52.359 - /Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/vue-cli-plugin-uni/index.js
[HBuilder] 16:47:52.364 - /Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@vue/cli-service/lib/Service.js
[HBuilder] 16:47:52.369 - /Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@vue/cli-service/bin/vue-cli-service.js
[HBuilder] 16:47:52.373 at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
[HBuilder] 16:47:52.379 at Function.Module._resolveFilename (/Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/module-alias/index.js:49:29)
[HBuilder] 16:47:52.384 at Function.Module._load (node:internal/modules/cjs/loader:804:27)
[HBuilder] 16:47:52.388 at Module.require (node:internal/modules/cjs/loader:1028:19)
[HBuilder] 16:47:52.393 at require (node:internal/modules/cjs/helpers:102:18)
[HBuilder] 16:47:52.397 at resolveNativeBinding (/Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uts/dist/binding.js:99:12)
[HBuilder] 16:47:52.398 at Object.<anonymous> (/Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uts/dist/binding.js:101:19)
[HBuilder] 16:47:52.402 at Module._compile (node:internal/modules/cjs/loader:1126:14)
[HBuilder] 16:47:52.403 at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
[HBuilder] 16:47:52.412 at Module.load (node:internal/modules/cjs/loader:1004:32)
[HBuilder] 16:47:52.418 at Function.Module._load (node:internal/modules/cjs/loader:839:12)
[HBuilder] 16:47:52.418 at Module.require (node:internal/modules/cjs/loader:1028:19)
[HBuilder] 16:47:52.423 at require (node:internal/modules/cjs/helpers:102:18)
[HBuilder] 16:47:52.427 at Object.<anonymous> (/Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uts/dist/api.js:9:7)
[HBuilder] 16:47:52.432 at Module._compile (node:internal/modules/cjs/loader:1126:14)
[HBuilder] 16:47:52.437 at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
[HBuilder] 16:47:52.441 at Module.load (node:internal/modules/cjs/loader:1004:32)
[HBuilder] 16:47:52.441 at Function.Module._load (node:internal/modules/cjs/loader:839:12)
[HBuilder] 16:47:52.446 at Module.require (node:internal/modules/cjs/loader:1028:19)
[HBuilder] 16:47:52.450 at require (node:internal/modules/cjs/helpers:102:18)
[HBuilder] 16:47:52.453 at Object.<anonymous> (/Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uts/dist/index.js:4:15)
[HBuilder] 16:47:52.458 at Module._compile (node:internal/modules/cjs/loader:1126:14)
[HBuilder] 16:47:52.462 at Object.Module._extensions..js (node:internal/modules/cjs/loader:1180:10)
[HBuilder] 16:47:52.463 at Module.load (node:internal/modules/cjs/loader:1004:32)
[HBuilder] 16:47:52.466 at Function.Module._load (node:internal/modules/cjs/loader:839:12)
[HBuilder] 16:47:52.470 at Module.require (node:internal/modules/cjs/loader:1028:19)
[HBuilder] 16:47:52.475 at require (node:internal/modules/cjs/helpers:102:18)
[HBuilder] 16:47:52.475 at parseInterfaceTypes (/Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uni-uts-v1/dist/code.js:231:23)
[HBuilder] 16:47:52.480 at genProxyCode (/Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uni-uts-v1/dist/code.js:24:27)
[HBuilder] 16:47:52.485 at Object.compile (/Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uni-uts-v1/dist/index.js:107:48)
[HBuilder] 16:47:52.489 at Object.<anonymous> (/Users/xierruisi/Documents/Working/fixon-miniprogram/node_modules/@dcloudio/uni-cli-shared/lib/uts/uts-loader.js:8:24)
[HBuilder] 16:47:52.496 Error: getaddrinfo ENOTFOUND 96f0e031-f37a-48ef-84c7-2023f6360c0a.bspapp.com
Fixon (作者)
注释掉pages.json中的uni-upgrade-center页面就可以打包成功
Fixon (作者)
hbuilderx卸载不掉这个插件
Fixon (作者)
尝试卸载hbuilderX重新安装,还是无法编译项目
Fixon (作者)
升级到4.0.6还是没办法打包
w***@126.com
同样问题,我也是MacBook Pro M1
执行pnpm i 也报错
ERR_PNPM_UNSUPPORTED_PLATFORM Unsupported platform for /@dcloudio/uts-darwin-x64/3.0.0-alpha-3040820220424005: wanted {"cpu":["x64"],"os":["darwin"],"libc":["any"]} (current: {"os":"darwin","cpu":"arm64","libc":"unknown"})
项目是uni-app 项目,并非uni-app x项目,为什么要依赖@dcloudio/uts-darwin-x64
DCloud_UNI_LXH
可以看一下这两个链接
https://issues.dcloud.net.cn/pages/issues/detail?id=1142
https://ask.dcloud.net.cn/question/145281