Tag Archives: Jenkins build error

[Solved] Jenkins build error: esbuild install failed

When building the front-end package of the company’s test environment, an error was suddenly reported and the construction failed. After checking the log, an error was reported and the esbuild installation failed. I have not installed this esbuild on Jenkins server, and the code proposed by the development is no problem.
solution:
first look for the esbuild directory in the front-end package. I found that there are two esbuild directories in my front-end package, and then I went in and found that there are install JS file, NPM – V check your own NPM version. If it is greater than 7, execute
node node_modules/esbuild/install.js
after manual installation, build from Jenkins again, and there will be no error

[Solved] Vite Project jenkins Auto Package Error: failed to load config from ../vite.config.js You installed esbuild on

The vite project reported an error in Jenkins automatic packaging and could not find esbuild-linux-64

If esbuild-windows-64 is not found for development in window environment, it needs to use esbuild-linux-64 for construction in Linux environment. If esbuild-linux-64 is not found, an error will be reported

Actual error reporting:

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.

Error reason: vite cannot find esbuild-linux-64 in Linux environment

Two solutions:
1. In the Linux environment, npm i esbuild-linux-64

2. You can view the esbuild-linux-64 version number in package-lock.json and modify and download it yourself, after downloading, unzip the package folder, rename it esbuild-linux-64 and copy it to the current project node_modules directory