-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: The package "esbuild-linux-64" could not be found, and is needed by esbuild #1646
Comments
Chiming on this bug as I'm fairly certain it's the exact same issue. I'm seeing a similar issue on Windows 10 (64-bit), except of course the error message is Here are NPM install logs:
|
After some thought im am closing this, because it seems more likely to be a Vitejs Error. Proof:
|
I can't reproduce this problem FWIW. I don't have Linux myself so I'm using https://gitpod.io/#https://github.com/christopher-caldwell/vite-material-ui but running
|
I used |
> stunning-app@0.0.0 serve:back /mnt/e/stunning-new
> esbuild scripts/serve-back.ts --format=esm --main-fields=module,main --outfile=scripts/serve-back.mjs --log-level=error --platform=node && node scripts/serve-back.mjs
/mnt/e/stunning-new/node_modules/.pnpm/esbuild@0.14.2/node_modules/esbuild/bin/esbuild:80
throw new Error(`The package "${pkg}" could not be found, and is needed by esbuild.
^
Error: The package "esbuild-linux-64" could not be found, and is needed by esbuild.
If you are installing esbuild with npm, make sure that you don't specify the
"--no-optional" flag. The "optionalDependencies" package.json feature is used
by esbuild to install the correct binary executable for your current platform.
at generateBinPath (/mnt/e/stunning-new/node_modules/.pnpm/esbuild@0.14.2/node_modules/esbuild/bin/esbuild:80:15)
at Object.<anonymous> (/mnt/e/stunning-new/node_modules/.pnpm/esbuild@0.14.2/node_modules/esbuild/bin/esbuild:108:39)
at Module._compile (node:internal/modules/cjs/loader:1097:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
at Module.load (node:internal/modules/cjs/loader:975:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47
Node.js v17.1.0
ELIFECYCLE Command failed with exit code 1. and it says that. |
This was causing issues for me deploying to Heroku using zero installs, since my local architecture (mac OS) is different from the server's (Linux). Modifying yarn's
|
getting this error on Netlify |
There is some recently-released documentation about this that may help: https://esbuild.github.io/getting-started/#simultaneous-platforms. I believe the Yarn-specific solution mentioned above in #1646 (comment) is one of the more robust ways to solve this. |
Not sure if this is related, but a colleague just came across a very similar error on Mac OS (M1). It said: Error: The package "esbuild-darwin-64" could not be found, and is needed by esbuild. This doesn't give any insights into the root cause, but for us, the solution was using node installed by homebrew in stead of a standalone install of nodejs. |
The easiest M1 solution is to run your terminal with rosetta. This solution will work for all M1 including the strange arch i386 on the mac mini. |
Apparently. it's not. I am getting it in Remix as well |
On MacOs/Monterey 12.1 with
ESBuild/Vite are running fine, but would it be possible to at least suppress this info? It's happening every time I add a new dependency and it's just creating a lot of unnecessary noise. |
That's a problem with npm, not with esbuild. It has been fixed but you'll need to update your version of npm to pick up the fix. Or you could add the |
I used yarn, can't be just npm then. Then I decided to dump esbuild altogether for the project |
Note: yarn 1 already solved "optionalDependencies" warnings some time ago. Maybe you can try to upgrade your yarn to 1.22.17. |
@ShafSpecs My issues were with |
i had the same issue, just run npm install, and it will work |
Im getting this error message with vite 2.8.5. |
For anyone still posting here, there is now documentation about this (copied from a few comments back): https://esbuild.github.io/getting-started/#simultaneous-platforms |
@panaman67 same here, please let me know if you were able to fix it |
Getting this error on Netlify as well and can't figure out what is causing it. I can guess it's a new dependency in the mix but I don't know which. Using vite + vue3. Unforuntately, both installing esbuild in the dev dependencies @ 0.13.4 and the solution from @jheruty have not resolved my issues. I don't know if this is related, but the build on Netlify does succeed only my HTML file is being received as a JSON file in the browser. |
I solved it by switching to pnpm |
I solved it, by the way, by adding an environment variable to my Netlify build settings for YARN_VERSION and made it use a newer version which doesn't have this problem. Additionally, my HTML file being sent as a JSON file was my mistake by adding headers for JSON and completely unrelated to this issue. |
Was on the same node version (16.11.1) and npm version (8.1.0) as my CI Netlify. Solved the issue by running |
I saw the comment about package lock. I've also got this error and have a project using vite (under the hood, svelte kit) and netlify. It worked fine on the same stack but my new branch had this problem. I remember I had a merge conflict in package.json and resolved it then ran I simply copied my package lock from my working branch (the one I'm trying to merge into, for you probably main or master). I then ran It now builds on netlify with no errors for me. |
This error happens if you develop on one platform, and deploy on another. For example you develop on windows, then in your One you can do, is to remove |
Delete the node_modules folder and install one more time. |
This happened to us because Netlify was caching a bad version of the ESBuild dependency, running their "clear cache and retry" worked. |
Hit this when caching node_modules as part of our CI pipeline. |
This is in the getting started documentation:
Yarn has this feature but npm doesn’t AFAIK. So you’d have to use Yarn if it want this feature. If you want npm to have this feature too then you’ll have to ask the npm team to add it to npm. |
I saw this in a Cloudflare community If you are trying to deploy your site, then set the environment variable NODE_VERSION on the deploy settings to anything newer or equal to v17.9.1. This will make the process to use the node version specified This version of node worked for me v18.10.0 |
Regarding Netlify caching and not respecting package-lock, here's a simple plugin I wrote to handle that: https://answers.netlify.com/t/how-to-enforce-package-lock-json/39735/29 |
I've fixed this issue by installing npm packages using |
Deleting the |
i'm facing the same error, i work in the team and we use different OS, and i use MAC with Vite |
Any final fix or core reason behind this error? |
I have same issue but with "error" instead "info" in my mac |
|
it work for me, to do this on building dockerfile |
In my development team, we encountered this error. |
@xcong4328 |
Hey folks, hitting this issue on Vercel. I am a bit worried about the indication to remove the "no-optional" flag. This is problematic in many contexts, since optional dependencies can list heavyweight development tools like Cypress that are a nightmare to handle when they install during development, while not being actually used to build the app. Optional is, well, supposed to be optional during build or runtime. |
What fixed for me was to add this package as an optional dependency in the
|
example project using a js framework/bundler that uses esbuild
direcltly installing and using esbuild by itself works, even globally
but global installation is not recognized by the bundler (https://vitejs.dev/)
The text was updated successfully, but these errors were encountered: