vite项目在jenkins自动打包报错:failed to load config from ../vite.config.js You installed esbuild on

这篇具有很好参考价值的文章主要介绍了vite项目在jenkins自动打包报错:failed to load config from ../vite.config.js You installed esbuild on。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

vite项目在jenkins自动打包报错找不到esbuild-linux-64

在window环境开发用的找不到esbuild-windows-64,在linux环境构建需要使用esbuild-linux-64,找不到esbuild-linux-64就会报错

实际报错:

error during build:
11:21:11 Error: 
11:21:11 You installed esbuild on another platform than the one you're currently using.
11:21:11 This won't work because esbuild is written with native code and needs to
11:21:11 install a platform-specific binary executable.
11:21:11 
11:21:11 Specifically the "esbuild-windows-64" package is present but this platform
11:21:11 needs the "esbuild-linux-64" package instead. People often get into this
11:21:11 situation by installing esbuild on Windows or macOS and copying "node_modules"
11:21:11 into a Docker image that runs Linux, or by copying "node_modules" between
11:21:11 Windows and WSL environments.

报错原因: vite在linux环境打找不到esbuild-linux-64

2种解决方案:
1、在linux环境下,打包前先 npm i esbuild-linux-64

2、在外网windows环境下运行以下命令(可在版本号去package-lock.json中查看esbuild-linux-64版本号后自行修改下载)
curl -O https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.34.tgz
下载后解压得到package文件夹,将其改名为esbuild-linux-64复制到当前项目node_modules目录下即可文章来源地址https://www.toymoban.com/news/detail-539292.html

到了这里,关于vite项目在jenkins自动打包报错:failed to load config from ../vite.config.js You installed esbuild on的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包