vue3+ts build 显示@esbuild/darwin-x64错误
Error:
You installed esbuild for 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-x64” package is present but this platform
needs the “@esbuild/darwin-arm64” package instead. People often get into this
situation by installing esbuild with npm running inside of Rosetta 2 and then
trying to use it with node running outside of Rosetta 2, or vice versa (Rosetta
2 is Apple’s on-the-fly x86_64-to-arm64 translation service).

在这里有解决办法

- 检查~/. vscode/extensions文件夹。如果它不存在,请检查互联网以查找 VSCode 在您的 Mac 中存储数据的位置。
- 在“henryansah.notejs-0.0.19”中打开终端(如果不同则替换版本号)并尝试“npm install esbuild-darwin-arm64”
然后就打包成功了:

文章讲述了在使用Vue3和TypeScript构建时遇到的esbuild平台不匹配错误,指出问题可能由npm在Rosetta2环境下的安装引起。解决方法是检查VSCode扩展文件夹中的esbuild-darwin-arm64包并重新安装。
2210

被折叠的 条评论
为什么被折叠?



