vite項(xiàng)目在jenkins自動(dòng)打包報(bào)錯(cuò)找不到esbuild-linux-64
在window環(huán)境開發(fā)用的找不到esbuild-windows-64
,在linux環(huán)境構(gòu)建需要使用esbuild-linux-64
,找不到esbuild-linux-64
就會(huì)報(bào)錯(cuò)
實(shí)際報(bào)錯(cuò):
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.
報(bào)錯(cuò)原因: vite在linux環(huán)境打找不到esbuild-linux-64
2種解決方案:
1、在linux環(huán)境下,打包前先 npm i esbuild-linux-64
文章來源:http://www.zghlxwxcb.cn/news/detail-539292.html
2、在外網(wǎng)windows環(huán)境下運(yùn)行以下命令(可在版本號去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復(fù)制到當(dāng)前項(xiàng)目node_modules目錄下即可文章來源地址http://www.zghlxwxcb.cn/news/detail-539292.html
到了這里,關(guān)于vite項(xiàng)目在jenkins自動(dòng)打包報(bào)錯(cuò):failed to load config from ../vite.config.js You installed esbuild on的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!