esbuild: Error: The package "esbuild-linux-64" could not be found, and is needed by esbuild
❯ uname -a
Linux ltl065 5.10.0-8-amd64 #1 SMP Debian 5.10.46-5 (2021-09-23) x86_64 GNU/Linux
# debian bullseye (stable)
❯ yarn --version
1.22.5
❯ node --version
v16.10.0
example project using a js framework/bundler that uses esbuild
git clone https://github.com/christopher-caldwell/vite-material-ui
yarn install
yarn install v1.22.5
warning package.json: No license field
info No lockfile found.
warning vite-ts-material-ui@0.0.0: No license field
[1/4] Resolving packages...
warning react-scripts > babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
warning react-scripts > webpack-dev-server > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning react-scripts > webpack-dev-server > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
warning react-scripts > @pmmmwh/react-refresh-webpack-plugin > native-url > querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning react-scripts > webpack-dev-server > url > querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
warning react-scripts > webpack-dev-server > sockjs > uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning react-scripts > webpack-dev-server > webpack-log > uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning react-scripts > workbox-webpack-plugin > workbox-build > rollup-plugin-babel@4.4.0: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-babel.
warning react-scripts > workbox-webpack-plugin > workbox-build > @hapi/joi@15.1.1: Switch to 'npm install joi'
warning react-scripts > webpack > watchpack > watchpack-chokidar2 > chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
warning react-scripts > babel-jest > @jest/transform > jest-haste-map > sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
warning react-scripts > postcss-preset-env > postcss-color-functional-notation > postcss-values-parser > flatten@1.0.3: flatten is deprecated in favor of utility frameworks such as lodash.
warning react-scripts > resolve-url-loader > rework > css > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning react-scripts > webpack > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/bourne@1.3.2: This version has been deprecated and is no longer supported or maintained
warning react-scripts > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/address@2.1.4: Moved to 'npm install @sideway/address'
warning react-scripts > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
warning react-scripts > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/topo@3.1.6: This version has been deprecated and is no longer supported or maintained
warning react-scripts > workbox-webpack-plugin > workbox-build > @hapi/joi > @hapi/topo > @hapi/hoek@8.5.1: This version has been deprecated and is no longer supported or maintained
warning react-scripts > webpack > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > strip-comments > babel-plugin-transform-object-rest-spread > babel-runtime > core-js@2.6.12: core-js@<3.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
[2/4] Fetching packages...
info fsevents@2.3.2: The platform "linux" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.13: The platform "linux" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-darwin-arm64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-darwin-arm64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-darwin-arm64@0.13.3: The CPU architecture "x64" is incompatible with this module.
info esbuild-freebsd-arm64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-freebsd-arm64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-freebsd-arm64@0.13.3: The CPU architecture "x64" is incompatible with this module.
info esbuild-linux-arm@0.13.3: The CPU architecture "x64" is incompatible with this module.
info "esbuild-linux-arm@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-freebsd-64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-freebsd-64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-32@0.13.3: The CPU architecture "x64" is incompatible with this module.
info "esbuild-linux-32@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-darwin-64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-darwin-64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-sunos-64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-sunos-64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-openbsd-64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-openbsd-64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-arm64@0.13.3: The CPU architecture "x64" is incompatible with this module.
info "esbuild-linux-arm64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-mips64le@0.13.3: The CPU architecture "x64" is incompatible with this module.
info "esbuild-linux-mips64le@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-arm64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-windows-arm64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-arm64@0.13.3: The CPU architecture "x64" is incompatible with this module.
info esbuild-android-arm64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-android-arm64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-android-arm64@0.13.3: The CPU architecture "x64" is incompatible with this module.
info esbuild-windows-32@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-windows-32@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-32@0.13.3: The CPU architecture "x64" is incompatible with this module.
info esbuild-windows-64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-windows-64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-ppc64le@0.13.3: The CPU architecture "x64" is incompatible with this module.
info "esbuild-linux-ppc64le@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
warning vscode-languageclient@7.0.0: The engine "vscode" appears to be invalid.
[3/4] Linking dependencies...
warning " > @caldwell619/react-hooks@0.0.6" has unmet peer dependency "next@>=11".
warning "@emotion/styled > @emotion/babel-plugin@11.3.0" has unmet peer dependency "@babel/core@^7.0.0".
warning "@emotion/styled > @emotion/babel-plugin > @babel/plugin-syntax-jsx@7.14.5" has unmet peer dependency "@babel/core@^7.0.0-0".
[4/4] Building fresh packages...
[-/5] ⡀ waiting...
[-/5] ⡀ waiting...
[-/5] ⡀ waiting...
[-/5] ⡀ waiting...
error /home/david/Develop/test/vite-mui-christoper-caldwell/node_modules/esbuild: Command failed.
Exit code: 1
Command: node install.js
Arguments:
Directory: /home/david/Develop/test/vite-mui-christoper-caldwell/node_modules/esbuild
Output:
/home/david/Develop/test/vite-mui-christoper-caldwell/node_modules/esbuild/install.js:45
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 binPathForCurrentPlatform (/home/david/Develop/test/vite-mui-christoper-caldwell/node_modules/esbuild/install.js:45:13)
at Object.<anonymous> (/home/david/Develop/test/vite-mui-christoper-caldwell/node_modules/esbuild/install.js:90:15)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
direcltly installing and using esbuild by itself works, even globally but global installation is not recognized by the bundler (https://vitejs.dev/)
❯ yarn global add esbuild
yarn global v1.22.5
warning package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
info esbuild-android-arm64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-android-arm64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-android-arm64@0.13.3: The CPU architecture "x64" is incompatible with this module.
info esbuild-darwin-64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-darwin-64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-darwin-arm64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-darwin-arm64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-darwin-arm64@0.13.3: The CPU architecture "x64" is incompatible with this module.
info esbuild-freebsd-64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-freebsd-64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-freebsd-arm64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-freebsd-arm64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-freebsd-arm64@0.13.3: The CPU architecture "x64" is incompatible with this module.
info esbuild-linux-32@0.13.3: The CPU architecture "x64" is incompatible with this module.
info "esbuild-linux-32@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-arm@0.13.3: The CPU architecture "x64" is incompatible with this module.
info "esbuild-linux-arm@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-arm64@0.13.3: The CPU architecture "x64" is incompatible with this module.
info "esbuild-linux-arm64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-mips64le@0.13.3: The CPU architecture "x64" is incompatible with this module.
info "esbuild-linux-mips64le@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-ppc64le@0.13.3: The CPU architecture "x64" is incompatible with this module.
info "esbuild-linux-ppc64le@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-openbsd-64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-openbsd-64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-sunos-64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-sunos-64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-32@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-windows-32@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-32@0.13.3: The CPU architecture "x64" is incompatible with this module.
info esbuild-windows-64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-windows-64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-arm64@0.13.3: The platform "linux" is incompatible with this module.
info "esbuild-windows-arm64@0.13.3" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-arm64@0.13.3: The CPU architecture "x64" is incompatible with this module.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "esbuild@0.13.3" with binaries:
- esbuild
Done in 0.86s.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 23
- Comments: 41 (5 by maintainers)
Commits related to this issue
- Trying this workaround from https://github.com/evanw/esbuild/issues/1646#issuecomment-1014153092 — committed to KenEucker/biketag-vue by KenEucker 2 years ago
- Fix build errors by specifying NPM version Related to https://github.com/evanw/esbuild/issues/1646 — committed to franknoirot/obsidian-nextjs-blog by franknoirot 2 years ago
- Manual install of esbuild-linux-64 package See https://github.com/evanw/esbuild/issues/1646 — committed to BryggansBryggeri/experimental_ui by jackonelli 2 years ago
- Try to fix CI tests https://stackoverflow.com/questions/73114555/package-not-accessible-from-esbuild-what-does-this-error-mean https://github.com/evanw/esbuild/issues/1646 — committed to alephium/explorer by mvaivre a year ago
Was on the same node version (16.11.1) and npm version (8.1.0) as my CI Netlify.
Solved the issue by running
npm i -D esbuild
getting this error on Netlify
Same issue here, updating npm, deleting the
node_modules
and then doing anpm i
got me back up and running.This error happens if you develop on one platform, and deploy on another. For example you develop on windows, then in your
package-lick.json
will be package"node_modules/esbuild-windows-64: {...}
, but when you want to deploy something on linux, it will fail. Becausenpm install
will install packages listed inpackage-lock.json
, it will not install required for linux platform packageesbuild-linux-64
. Dead end.One you can do, is to remove
node_modules
,package-lock.json
before every install, or may be before only first install. Removingnode_modules
is some kind of monkey patching. Removingpackage-lock.json
can be bad idea too.This seems to happen to my teammate and I when one of us updates
package-lock.json
by installing a new dependency. One of us is on an intel mac, and the other is on an m1 mac.npm
does not seem to handle that very well.Im getting this error message with vite 2.8.5.
After some thought im am closing this, because it seems more likely to be a Vitejs Error. I opened a Bug in Vitejs instead -> https://github.com/vitejs/vite/issues/5187
Proof:
yarn global install esbuild
runs successfullyI’ve fixed this issue by installing npm packages using
npm ci
Deleting the
package-lock.json
and runningnpm rebuild
thennpm install
was sufficient to solve the issue for me.Any final fix or core reason behind this error?
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 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
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.
This happened to us because Netlify was caching a bad version of the ESBuild dependency, running their “clear cache and retry” worked.
i had the same issue, just run npm install, and it will work
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
-s
flag to npm to silence the output. Or you could setnpm config set loglevel silent
.i’m facing the same error, i work in the team and we use different OS, and i use MAC with Vite
Hit this when caching node_modules as part of our CI pipeline. As our runners are ephemeral and could be arm64 or amd64 etc the cached node_modules was causing this issue to pop up. Our simple solution with npm was to use
npm ci
instead ofnpm install
to get a clean install with the correct binary for the active arch. Unfortunately this does mean there’s little point caching the node_modules directory. Wonder if it’s possible to install for multiple archs?I solved it by switching to pnpm
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
I used yarn, can’t be just npm then. Then I decided to dump esbuild altogether for the project
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
The package "esbuild-windows-64" could not be found
. Also using esbuild v0.13.3 via Vite.Here are NPM install logs: