1***@qq.com
1***@qq.com
  • 发布:2023-05-25 09:43
  • 更新:2023-08-19 11:17
  • 阅读:1037

运行项目报错,提示打不开vite.config.js

分类:HBuilderX

今早突然出现这个问题,新建一项目运行也是这问题,HBuilderX重新下载了也不行

09:33:46.987 项目 'test2' 开始编译...
09:33:48.533 请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。
09:33:48.536 正在编译中...
09:33:48.543 failed to load config from E:\HBuilderX\plugins\uniapp-cli-vite\vite.config.js
09:33:48.547 error when starting dev server:
09:33:48.549 Error:
09:33:48.551 You installed esbuild for another platform than the one you're currently using.
09:33:48.552 This won't work because esbuild is written with native code and needs to
09:33:48.555 install a platform-specific binary executable.
09:33:48.557 Specifically the "@esbuild/win32-ia32" package is present but this platform
09:33:48.560 needs the "@esbuild/win32-ia32" package instead. People often get into this
09:33:48.562 situation by installing esbuild on Windows or macOS and copying "node_modules"
09:33:48.565 into a Docker image that runs Linux, or by copying "node_modules" between
09:33:48.567 Windows and WSL environments.
09:33:48.569 If you are installing with npm, you can try not copying the "node_modules"
09:33:48.572 directory when you copy the files over, and running "npm ci" or "npm install"
09:33:48.574 on the destination platform after the copy. Or you could consider using yarn
09:33:48.575 instead of npm which has built-in support for installing a package on multiple
09:33:48.577 platforms simultaneously.
09:33:48.579 If you are installing with yarn, you can try listing both this platform and the
09:33:48.581 other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
09:33:48.583 feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures
09:33:48.585 Keep in mind that this means multiple copies of esbuild will be present.
09:33:48.587 Another alternative is to use the "esbuild-wasm" package instead, which works
09:33:48.589 the same way on all platforms. But it comes with a heavy performance cost and
09:33:48.591 can sometimes be 10x slower than the "esbuild" package, so you may also not
09:33:48.593 want to do that.
09:33:48.595 at generateBinPath (E:\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:1841:17)
09:33:48.598 at esbuildCommandAndArgs (E:\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:1922:33)
09:33:48.600 at ensureServiceIsRunning (E:\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:2087:25)
09:33:48.602 at build (E:\HBuilderX\plugins\uniapp-cli-vite\node_modules\esbuild\lib\main.js:1978:26)
09:33:48.605 at bundleConfigFile (file:///E:/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-ca21228b.js:62245:26)
09:33:48.607 at loadConfigFromFile (file:///E:/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-ca21228b.js:62221:31)
09:33:48.609 at resolveConfig (file:///E:/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-ca21228b.js:61843:34)
09:33:48.612 at Module.createServer (file:///E:/HBuilderX/plugins/uniapp-cli-vite/node_modules/vite/dist/node/chunks/dep-ca21228b.js:61153:26)
09:33:48.614 at E:\HBuilderX\plugins\uniapp-cli-vite\node_modules\vite\index.cjs:23:55
09:33:48.617 at async createServer (E:\HBuilderX\plugins\uniapp-cli-vite\node_modules\@dcloudio\vite-plugin-uni\dist\cli\server.js:44:20)

2023-05-25 09:43 负责人:无 分享
已邀请:
DCloud_UNI_GSQ

DCloud_UNI_GSQ

编译插件卸载重装试试

  • 1***@qq.com (作者)

    我重装win10就正常了,然后又出现了一次,原来是360把esbuild当木马隔离了,还原就可以了。

    2023-06-02 08:35

l***@163.com

l***@163.com

卸载这个插件重新安装

要回复问题请先登录注册