一个Vue3版本的uniAPP项目,昨晚编译环境一切正常,今日打开编译报错,怀疑旧版升级导致,后下重新最新4.15版相同源码进行编译,报上述错错误
- 发布:2024-05-10 07:26
- 更新:2024-05-10 11:07
- 阅读:491
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: WINDOWS11
HBuilderX类型: 正式
HBuilderX版本号: 4.15
手机系统: Android
手机系统版本号: Android 14
手机厂商: 华为
手机机型: NOVA5
页面类型: vue
vue版本: vue3
打包方式: 云端
项目创建方式: HBuilderX
操作步骤:
预期结果:
测试时希望能在4.15版正常
测试时希望能在4.15版正常
实际结果:
仍然报错:
[广告] 07:25:24.334 uni-cdn,帮你节省至少30%的 CDN 费用!详情
07:25:24.387 项目 'ent-safety' 开始编译...
07:25:25.795 请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。
07:25:25.802 编译器版本:4.15(vue3)
07:25:25.809 正在编译中...
07:25:25.817 failed to load config from D:\Program Files\HBuilderX\plugins\uniapp-cli-vite\vite.config.js
07:25:25.824 error during build:
07:25:25.832 Error:
07:25:25.839 You installed esbuild for another platform than the one you're currently using.
07:25:25.850 This won't work because esbuild is written with native code and needs to
07:25:25.857 install a platform-specific binary executable.
07:25:25.866 Specifically the "@esbuild/win32-ia32" package is present but this platform
07:25:25.873 needs the "@esbuild/win32-x64" package instead. People often get into this
07:25:25.880 situation by installing esbuild on Windows or macOS and copying "node_modules"
07:25:25.889 into a Docker image that runs Linux, or by copying "node_modules" between
07:25:25.897 Windows and WSL environments.
07:25:25.906 If you are installing with npm, you can try not copying the "node_modules"
07:25:25.915 directory when you copy the files over, and running "npm ci" or "npm install"
07:25:25.923 on the destination platform after the copy. Or you could consider using yarn
07:25:25.932 instead of npm which has built-in support for installing a package on multiple
07:25:25.940 platforms simultaneously.
07:25:25.948 If you are installing with yarn, you can try listing both this platform and the
07:25:25.957 other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
07:25:25.965 feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
07:25:25.973 Keep in mind that this means multiple copies of esbuild will be present.
07:25:25.982 Another alternative is to use the "esbuild-wasm" package instead, which works
07:25:25.991 the same way on all platforms. But it comes with a heavy performance cost and
07:25:25.999 can sometimes be 10x slower than the "esbuild" package, so you may also not
07:25:26.008 want to do that.
07:25:26.017 at generateBinPath (D:\Program Files\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:1910:17)
07:25:26.025 at esbuildCommandAndArgs (D:\Program Files\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:1991:33)
07:25:26.035 at ensureServiceIsRunning (D:\Program Files\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:2163:25)
07:25:26.044 at build (D:\Program Files\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:2047:26)
07:25:26.053 at bundleConfigFile (file:///D:/Program%20Files/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:68553:26)
07:25:26.062 at loadConfigFromFile (file:///D:/Program%20Files/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:68527:31)
07:25:26.072 at resolveConfig (file:///D:/Program%20Files/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:68138:34)
07:25:26.081 at Module.build (file:///D:/Program%20Files/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:67273:26)
07:25:26.091 at D:\Program Files\HBuilderX\plugins\uniapp-cli-vite\node_modules\vite\index.cjs:25:55
07:25:26.102 at async buildApp (D:\Program Files\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\dist\cli\build.js:129:24)
仍然报错:
[广告] 07:25:24.334 uni-cdn,帮你节省至少30%的 CDN 费用!详情
07:25:24.387 项目 'ent-safety' 开始编译...
07:25:25.795 请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。
07:25:25.802 编译器版本:4.15(vue3)
07:25:25.809 正在编译中...
07:25:25.817 failed to load config from D:\Program Files\HBuilderX\plugins\uniapp-cli-vite\vite.config.js
07:25:25.824 error during build:
07:25:25.832 Error:
07:25:25.839 You installed esbuild for another platform than the one you're currently using.
07:25:25.850 This won't work because esbuild is written with native code and needs to
07:25:25.857 install a platform-specific binary executable.
07:25:25.866 Specifically the "@esbuild/win32-ia32" package is present but this platform
07:25:25.873 needs the "@esbuild/win32-x64" package instead. People often get into this
07:25:25.880 situation by installing esbuild on Windows or macOS and copying "node_modules"
07:25:25.889 into a Docker image that runs Linux, or by copying "node_modules" between
07:25:25.897 Windows and WSL environments.
07:25:25.906 If you are installing with npm, you can try not copying the "node_modules"
07:25:25.915 directory when you copy the files over, and running "npm ci" or "npm install"
07:25:25.923 on the destination platform after the copy. Or you could consider using yarn
07:25:25.932 instead of npm which has built-in support for installing a package on multiple
07:25:25.940 platforms simultaneously.
07:25:25.948 If you are installing with yarn, you can try listing both this platform and the
07:25:25.957 other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
07:25:25.965 feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
07:25:25.973 Keep in mind that this means multiple copies of esbuild will be present.
07:25:25.982 Another alternative is to use the "esbuild-wasm" package instead, which works
07:25:25.991 the same way on all platforms. But it comes with a heavy performance cost and
07:25:25.999 can sometimes be 10x slower than the "esbuild" package, so you may also not
07:25:26.008 want to do that.
07:25:26.017 at generateBinPath (D:\Program Files\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:1910:17)
07:25:26.025 at esbuildCommandAndArgs (D:\Program Files\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:1991:33)
07:25:26.035 at ensureServiceIsRunning (D:\Program Files\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:2163:25)
07:25:26.044 at build (D:\Program Files\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:2047:26)
07:25:26.053 at bundleConfigFile (file:///D:/Program%20Files/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:68553:26)
07:25:26.062 at loadConfigFromFile (file:///D:/Program%20Files/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:68527:31)
07:25:26.072 at resolveConfig (file:///D:/Program%20Files/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:68138:34)
07:25:26.081 at Module.build (file:///D:/Program%20Files/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:67273:26)
07:25:26.091 at D:\Program Files\HBuilderX\plugins\uniapp-cli-vite\node_modules\vite\index.cjs:25:55
07:25:26.102 at async buildApp (D:\Program Files\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\dist\cli\build.js:129:24)
bug描述:
[广告] 07:24:16.404 uni-cdn,帮你节省至少30%的 CDN 费用!详情
07:24:16.456 项目 'ent-safety' 开始编译...
07:24:18.149 请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。
07:24:18.158 编译器版本:4.15(vue3)
07:24:18.172 正在编译中...
07:24:18.194 failed to load config from D:\tools\HBuilderX\plugins\uniapp-cli-vite\vite.config.js
07:24:18.214 error during build:
07:24:18.224 Error:
07:24:18.232 You installed esbuild for another platform than the one you're currently using.
07:24:18.243 This won't work because esbuild is written with native code and needs to
07:24:18.252 install a platform-specific binary executable.
07:24:18.261 Specifically the "@esbuild/win32-ia32" package is present but this platform
07:24:18.270 needs the "@esbuild/win32-x64" package instead. People often get into this
07:24:18.281 situation by installing esbuild on Windows or macOS and copying "node_modules"
07:24:18.292 into a Docker image that runs Linux, or by copying "node_modules" between
07:24:18.303 Windows and WSL environments.
07:24:18.312 If you are installing with npm, you can try not copying the "node_modules"
07:24:18.321 directory when you copy the files over, and running "npm ci" or "npm install"
07:24:18.330 on the destination platform after the copy. Or you could consider using yarn
07:24:18.340 instead of npm which has built-in support for installing a package on multiple
07:24:18.351 platforms simultaneously.
07:24:18.360 If you are installing with yarn, you can try listing both this platform and the
07:24:18.370 other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
07:24:18.380 feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
07:24:18.389 Keep in mind that this means multiple copies of esbuild will be present.
07:24:18.399 Another alternative is to use the "esbuild-wasm" package instead, which works
07:24:18.411 the same way on all platforms. But it comes with a heavy performance cost and
07:24:18.420 can sometimes be 10x slower than the "esbuild" package, so you may also not
07:24:18.432 want to do that.
07:24:18.441 at generateBinPath (D:\tools\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:1910:17)
07:24:18.451 at esbuildCommandAndArgs (D:\tools\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:1991:33)
07:24:18.460 at ensureServiceIsRunning (D:\tools\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:2163:25)
07:24:18.471 at build (D:\tools\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:2047:26)
07:24:18.481 at bundleConfigFile (file:///D:/tools/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:68553:26)
07:24:18.493 at loadConfigFromFile (file:///D:/tools/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:68527:31)
07:24:18.504 at resolveConfig (file:///D:/tools/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:68138:34)
07:24:18.516 at Module.build (file:///D:/tools/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-whKeNLxG.js:67273:26)
07:24:18.527 at D:\tools\HBuilderX\plugins\uniapp-cli-vite\node_modules\vite\index.cjs:25:55
07:24:18.538 at async buildApp (D:\tools\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\dist\cli\build.js:129:24)
1 个回复
l***@163.com
顶,同样遇到错误了,一转小程序直接白屏