[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

Read More: