Tencent / tdesign-vue-next-starter

A starter-kit for TDesign Vue Next UI components
https://tdesign.tencent.com/starter/vue-next/
MIT License
684 stars 187 forks source link

运行npm run build 打包不了! #56

Closed letvav closed 2 years ago

letvav commented 2 years ago

You installed esbuild on another platform than the one you're currently using. This won't work because esbuild is written with native code and needs to install a platform-specific binary executable.

Specifically the "esbuild-darwin-arm64" package is present but this platform needs the "esbuild-darwin-64" package instead. People often get into this situation by installing esbuild on Windows or macOS and copying "node_modules" into a Docker image that runs Linux, or by copying "node_modules" between Windows and WSL environments.

If you are installing with npm, you can try not copying the "node_modules" directory when you copy the files over, and running "npm ci" or "npm install" on the destination platform after the copy. Or you could consider using yarn instead which has built-in support for installing a package on multiple platforms simultaneously.

If you are installing with yarn, you can try listing both this platform and the other platform in your ".yarnrc.yml" file using the "supportedArchitectures" feature: https://yarnpkg.com/configuration/yarnrc/#supportedArchitectures Keep in mind that this means multiple copies of esbuild will be present.

Another alternative is to use the "esbuild-wasm" package instead, which works the same way on all platforms. But it comes with a heavy performance cost and can sometimes be 10x slower than the "esbuild" package, so you may also not want to do that.

uyarn commented 2 years ago

提供一下操作系统和Node版本~

yixiaco commented 2 years ago

提供一下操作系统和Node版本~

node 16.13.2 windows 10 tdesign 0.9.2 我也打包失败了

如果使用unplugin-vue-components 和 unplugin-auto-import 来实现自动导入 会出现另外的打包错误

yixiaco commented 2 years ago

"build": "vue-tsc --noEmit --skipLibCheck && vite build --mode release" 跳过依赖包校验,可以打包成功