m***@163.com
m***@163.com
  • 发布:2022-05-13 18:09
  • 更新:2022-05-20 16:43
  • 阅读:2962

cli 命令行开发, 用 HBX编译,报错, M1芯片

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

PC开发环境操作系统版本号: 12.2

手机系统: 全部

手机厂商: 华为

页面类型: vue

vue版本: vue3

打包方式: 云端

项目创建方式: CLI

CLI版本号: vue3

示例代码:

You installed esbuild on another platform than the one you're currently using.
18:07:12.844 This won't work because esbuild is written with native code and needs to
18:07:12.846 install a platform-specific binary executable.
18:07:12.849 Specifically the "esbuild-darwin-arm64" package is present but this platform
18:07:12.849 needs the "esbuild-darwin-64" package instead. People often get into this
18:07:12.850 situation by installing esbuild on Windows or macOS and copying "node_modules"
18:07:12.852 into a Docker image that runs Linux, or by copying "node_modules" between
18:07:12.853 Windows and WSL environments.
18:07:12.854 If you are installing with npm, you can try not copying the "node_modules"
18:07:12.856 directory when you copy the files over, and running "npm ci" or "npm install"
18:07:12.856 on the destination platform after the copy. Or you could consider using yarn
18:07:12.858 instead which has built-in support for installing a package on multiple
18:07:12.859 platforms simultaneously.
18:07:12.861 If you are installing with yarn, you can try listing both this platform and the
18:07:12.861 other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
18:07:12.862 feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
18:07:12.871 Keep in mind that this means multiple copies of esbuild will be present.
18:07:12.875 Another alternative is to use the "esbuild-wasm" package instead, which works
18:07:12.877 the same way on all platforms. But it comes with a heavy performance cost and
18:07:12.878 can sometimes be 10x slower than the "esbuild" package, so you may also not
18:07:12.878 want to do that.

操作步骤:

You installed esbuild on another platform than the one you're currently using.
18:07:12.844 This won't work because esbuild is written with native code and needs to
18:07:12.846 install a platform-specific binary executable.
18:07:12.849 Specifically the "esbuild-darwin-arm64" package is present but this platform
18:07:12.849 needs the "esbuild-darwin-64" package instead. People often get into this
18:07:12.850 situation by installing esbuild on Windows or macOS and copying "node_modules"
18:07:12.852 into a Docker image that runs Linux, or by copying "node_modules" between
18:07:12.853 Windows and WSL environments.
18:07:12.854 If you are installing with npm, you can try not copying the "node_modules"
18:07:12.856 directory when you copy the files over, and running "npm ci" or "npm install"
18:07:12.856 on the destination platform after the copy. Or you could consider using yarn
18:07:12.858 instead which has built-in support for installing a package on multiple
18:07:12.859 platforms simultaneously.
18:07:12.861 If you are installing with yarn, you can try listing both this platform and the
18:07:12.861 other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
18:07:12.862 feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
18:07:12.871 Keep in mind that this means multiple copies of esbuild will be present.
18:07:12.875 Another alternative is to use the "esbuild-wasm" package instead, which works
18:07:12.877 the same way on all platforms. But it comes with a heavy performance cost and
18:07:12.878 can sometimes be 10x slower than the "esbuild" package, so you may also not
18:07:12.878 want to do that.

预期结果:

You installed esbuild on another platform than the one you're currently using.
18:07:12.844 This won't work because esbuild is written with native code and needs to
18:07:12.846 install a platform-specific binary executable.
18:07:12.849 Specifically the "esbuild-darwin-arm64" package is present but this platform
18:07:12.849 needs the "esbuild-darwin-64" package instead. People often get into this
18:07:12.850 situation by installing esbuild on Windows or macOS and copying "node_modules"
18:07:12.852 into a Docker image that runs Linux, or by copying "node_modules" between
18:07:12.853 Windows and WSL environments.
18:07:12.854 If you are installing with npm, you can try not copying the "node_modules"
18:07:12.856 directory when you copy the files over, and running "npm ci" or "npm install"
18:07:12.856 on the destination platform after the copy. Or you could consider using yarn
18:07:12.858 instead which has built-in support for installing a package on multiple
18:07:12.859 platforms simultaneously.
18:07:12.861 If you are installing with yarn, you can try listing both this platform and the
18:07:12.861 other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
18:07:12.862 feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
18:07:12.871 Keep in mind that this means multiple copies of esbuild will be present.
18:07:12.875 Another alternative is to use the "esbuild-wasm" package instead, which works
18:07:12.877 the same way on all platforms. But it comes with a heavy performance cost and
18:07:12.878 can sometimes be 10x slower than the "esbuild" package, so you may also not
18:07:12.878 want to do that.

实际结果:

You installed esbuild on another platform than the one you're currently using.
18:07:12.844 This won't work because esbuild is written with native code and needs to
18:07:12.846 install a platform-specific binary executable.
18:07:12.849 Specifically the "esbuild-darwin-arm64" package is present but this platform
18:07:12.849 needs the "esbuild-darwin-64" package instead. People often get into this
18:07:12.850 situation by installing esbuild on Windows or macOS and copying "node_modules"
18:07:12.852 into a Docker image that runs Linux, or by copying "node_modules" between
18:07:12.853 Windows and WSL environments.
18:07:12.854 If you are installing with npm, you can try not copying the "node_modules"
18:07:12.856 directory when you copy the files over, and running "npm ci" or "npm install"
18:07:12.856 on the destination platform after the copy. Or you could consider using yarn
18:07:12.858 instead which has built-in support for installing a package on multiple
18:07:12.859 platforms simultaneously.
18:07:12.861 If you are installing with yarn, you can try listing both this platform and the
18:07:12.861 other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
18:07:12.862 feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
18:07:12.871 Keep in mind that this means multiple copies of esbuild will be present.
18:07:12.875 Another alternative is to use the "esbuild-wasm" package instead, which works
18:07:12.877 the same way on all platforms. But it comes with a heavy performance cost and
18:07:12.878 can sometimes be 10x slower than the "esbuild" package, so you may also not
18:07:12.878 want to do that.

bug描述:

You installed esbuild on another platform than the one you're currently using.
18:07:12.844 This won't work because esbuild is written with native code and needs to
18:07:12.846 install a platform-specific binary executable.
18:07:12.849 Specifically the "esbuild-darwin-arm64" package is present but this platform
18:07:12.849 needs the "esbuild-darwin-64" package instead. People often get into this
18:07:12.850 situation by installing esbuild on Windows or macOS and copying "node_modules"
18:07:12.852 into a Docker image that runs Linux, or by copying "node_modules" between
18:07:12.853 Windows and WSL environments.
18:07:12.854 If you are installing with npm, you can try not copying the "node_modules"
18:07:12.856 directory when you copy the files over, and running "npm ci" or "npm install"
18:07:12.856 on the destination platform after the copy. Or you could consider using yarn
18:07:12.858 instead which has built-in support for installing a package on multiple
18:07:12.859 platforms simultaneously.
18:07:12.861 If you are installing with yarn, you can try listing both this platform and the
18:07:12.861 other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
18:07:12.862 feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
18:07:12.871 Keep in mind that this means multiple copies of esbuild will be present.
18:07:12.875 Another alternative is to use the "esbuild-wasm" package instead, which works
18:07:12.877 the same way on all platforms. But it comes with a heavy performance cost and
18:07:12.878 can sometimes be 10x slower than the "esbuild" package, so you may also not
18:07:12.878 want to do that.

2022-05-13 18:09 负责人:无 分享
已邀请:

最佳回复

项目目录

项目目录

该问题我已经解决
参考
https://ask.dcloud.net.cn/question/145281

项目目录

项目目录

同问,我也是这个问题。哪怕我项目建立好了,上传到git仓库,再从仓库拉到其他目录。再次运行npm install 项目使用面板的运行也报上面的错误,但如果使用命令行, npm run dev:h5可以,但是我要做的是app

该问题目前已经被锁定, 无法添加新回复