evanw / esbuild

An extremely fast bundler for the web
https://esbuild.github.io/
MIT License
38.17k stars 1.15k forks source link

Error: The package "esbuild-linux-64" could not be found, and is needed by esbuild #1646

Closed zeromancer closed 3 years ago

zeromancer commented 3 years ago
❯ 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. ```
fwouts commented 3 years ago

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:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-android-arm64@0.13.3 (node_modules\esbuild\node_modules\esbuild-android-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-android-arm64@0.13.3: wanted {"os":"android","arch":"arm64"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-darwin-64@0.13.3 (node_modules\esbuild\node_modules\esbuild-darwin-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-darwin-64@0.13.3: wanted {"os":"darwin","arch":"x64"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-freebsd-arm64@0.13.3 (node_modules\esbuild\node_modules\esbuild-freebsd-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-freebsd-arm64@0.13.3: wanted {"os":"freebsd","arch":"arm64"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-darwin-arm64@0.13.3 (node_modules\esbuild\node_modules\esbuild-darwin-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-darwin-arm64@0.13.3: wanted {"os":"darwin","arch":"arm64"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-freebsd-64@0.13.3 (node_modules\esbuild\node_modules\esbuild-freebsd-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-freebsd-64@0.13.3: wanted {"os":"freebsd","arch":"x64"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-32@0.13.3 (node_modules\esbuild\node_modules\esbuild-linux-32):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-32@0.13.3: wanted {"os":"linux","arch":"ia32"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-64@0.13.3 (node_modules\esbuild\node_modules\esbuild-linux-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-64@0.13.3: wanted {"os":"linux","arch":"x64"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-arm@0.13.3 (node_modules\esbuild\node_modules\esbuild-linux-arm):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-arm@0.13.3: wanted {"os":"linux","arch":"arm"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-arm64@0.13.3 (node_modules\esbuild\node_modules\esbuild-linux-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-arm64@0.13.3: wanted {"os":"linux","arch":"arm64"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-mips64le@0.13.3 (node_modules\esbuild\node_modules\esbuild-linux-mips64le):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-mips64le@0.13.3: wanted {"os":"linux","arch":"mips64el"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-linux-ppc64le@0.13.3 (node_modules\esbuild\node_modules\esbuild-linux-ppc64le):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-linux-ppc64le@0.13.3: wanted {"os":"linux","arch":"ppc64"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-openbsd-64@0.13.3 (node_modules\esbuild\node_modules\esbuild-openbsd-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-openbsd-64@0.13.3: wanted {"os":"openbsd","arch":"x64"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-sunos-64@0.13.3 (node_modules\esbuild\node_modules\esbuild-sunos-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-sunos-64@0.13.3: wanted {"os":"sunos","arch":"x64"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-arm64@0.13.3 (node_modules\esbuild\node_modules\esbuild-windows-arm64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-arm64@0.13.3: wanted {"os":"win32","arch":"arm64"} (current: {"os":"win32","arch":"ia32"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: esbuild-windows-64@0.13.3 (node_modules\esbuild\node_modules\esbuild-windows-64):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for esbuild-windows-64@0.13.3: wanted {"os":"win32","arch":"x64"} (current: {"os":"win32","arch":"ia32"})
zeromancer commented 3 years ago

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 successfully

``` ❯ 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... warning Your current version of Yarn is out of date. The latest version is "1.22.15", while you're on "1.22.5". info To upgrade, run the following command: $ sudo apt-get update && sudo apt-get install yarn success Installed "esbuild@0.13.3" with binaries: - esbuild Done in 0.75s. ```
evanw commented 3 years ago

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 yarn install succeeds without an issue:

gitpod /workspace/vite-material-ui $ npm i -g yarn@1.22.5
/home/gitpod/.nvm/versions/node/v14.17.6/bin/yarn -> /home/gitpod/.nvm/versions/node/v14.17.6/lib/node_modules/yarn/bin/yarn.js
/home/gitpod/.nvm/versions/node/v14.17.6/bin/yarnpkg -> /home/gitpod/.nvm/versions/node/v14.17.6/lib/node_modules/yarn/bin/yarn.js
+ yarn@1.22.5
updated 1 package in 0.474s

gitpod /workspace/vite-material-ui $ yarn --version
1.22.5

gitpod /workspace/vite-material-ui $ yarn install
yarn install v1.22.5
warning package.json: No license field
warning vite-ts-material-ui@0.0.0: No license field
[1/4] Resolving packages...
[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.
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...
warning Your current version of Yarn is out of date. The latest version is "1.22.15", while you're on "1.22.5".
info To upgrade, run the following command:
$ curl --compressed -o- -L https://yarnpkg.com/install.sh | bash
Done in 107.29s.
7086cmd commented 2 years ago

I used WSL2 Ubuntu, and I use pnpm install esbuild -g successfully, while it couldn't build successfully.

7086cmd commented 2 years ago

> 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.

jheruty commented 2 years ago

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 supportedArchitectures in .yarnrc.yml worked for me:

supportedArchitectures:
  os:
    - "current"
    - "linux"
  cpu:
    - "current"
    - "x64"
breezybaldwin commented 2 years ago

getting this error on Netlify

evanw commented 2 years ago

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 https://github.com/evanw/esbuild/issues/1646#issuecomment-1014153092 is one of the more robust ways to solve this.

danielterwiel commented 2 years ago

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.

Miguel-Bento-Github commented 2 years ago

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.

ShafSpecs commented 2 years ago

After some thought im am closing this, because it seems more likely to be a Vitejs Error. I opened a Bug in Vitejs instead -> vitejs/vite#5187

Proof: yarn global install esbuild runs successfully

Apparently. it's not. I am getting it in Remix as well

K3TH3R commented 2 years ago

On MacOs/Monterey 12.1 with vite@2.8.0-beta.6, which is using esbuild@0.14.14, I am still seeing this spam:

info esbuild-android-arm64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-android-arm64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-android-arm64@0.13.8: The CPU architecture "x64" is incompatible with this module.
info esbuild-darwin-arm64@0.13.8: The CPU architecture "x64" is incompatible with this module.
info "esbuild-darwin-arm64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-freebsd-64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-freebsd-64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-freebsd-arm64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-freebsd-arm64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-freebsd-arm64@0.13.8: The CPU architecture "x64" is incompatible with this module.
info esbuild-linux-32@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-linux-32@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-32@0.13.8: The CPU architecture "x64" is incompatible with this module.
info esbuild-linux-64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-linux-64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-arm@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-linux-arm@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-arm@0.13.8: The CPU architecture "x64" is incompatible with this module.
info esbuild-linux-arm64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-linux-arm64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-arm64@0.13.8: The CPU architecture "x64" is incompatible with this module.
info esbuild-linux-mips64le@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-linux-mips64le@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-mips64le@0.13.8: The CPU architecture "x64" is incompatible with this module.
info esbuild-linux-ppc64le@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-linux-ppc64le@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-ppc64le@0.13.8: The CPU architecture "x64" is incompatible with this module.
info esbuild-netbsd-64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-netbsd-64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-openbsd-64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-openbsd-64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-sunos-64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-sunos-64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-32@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-windows-32@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-32@0.13.8: The CPU architecture "x64" is incompatible with this module.
info esbuild-windows-64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-windows-64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-arm64@0.13.8: The platform "darwin" is incompatible with this module.
info "esbuild-windows-arm64@0.13.8" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-arm64@0.13.8: The CPU architecture "x64" is incompatible with this module.
info esbuild-android-arm64@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-android-arm64@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-android-arm64@0.14.20: The CPU architecture "x64" is incompatible with this module.
info esbuild-freebsd-64@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-freebsd-64@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-freebsd-arm64@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-freebsd-arm64@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-freebsd-arm64@0.14.20: The CPU architecture "x64" is incompatible with this module.
info esbuild-linux-64@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-linux-64@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-arm@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-linux-arm@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-arm@0.14.20: The CPU architecture "x64" is incompatible with this module.
info esbuild-linux-s390x@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-linux-s390x@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-s390x@0.14.20: The CPU architecture "x64" is incompatible with this module.
info esbuild-linux-ppc64le@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-linux-ppc64le@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-ppc64le@0.14.20: The CPU architecture "x64" is incompatible with this module.
info esbuild-linux-mips64le@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-linux-mips64le@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-mips64le@0.14.20: The CPU architecture "x64" is incompatible with this module.
info esbuild-linux-arm64@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-linux-arm64@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-arm64@0.14.20: The CPU architecture "x64" is incompatible with this module.
info esbuild-linux-32@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-linux-32@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-linux-32@0.14.20: The CPU architecture "x64" is incompatible with this module.
info esbuild-netbsd-64@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-netbsd-64@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-openbsd-64@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-openbsd-64@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-32@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-windows-32@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-32@0.14.20: The CPU architecture "x64" is incompatible with this module.
info esbuild-windows-arm64@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-windows-arm64@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-arm64@0.14.20: The CPU architecture "x64" is incompatible with this module.
info esbuild-sunos-64@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-sunos-64@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-windows-64@0.14.20: The platform "darwin" is incompatible with this module.
info "esbuild-windows-64@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.
info esbuild-darwin-arm64@0.14.20: The CPU architecture "x64" is incompatible with this module.
info "esbuild-darwin-arm64@0.14.20" is an optional dependency and failed compatibility check. Excluding it from installation.

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.

evanw commented 2 years ago

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 set npm config set loglevel silent.

ShafSpecs commented 2 years ago

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 set npm config set loglevel silent.

I used yarn, can't be just npm then. Then I decided to dump esbuild altogether for the project

hyrious commented 2 years ago

Note: yarn 1 already solved "optionalDependencies" warnings some time ago. Maybe you can try to upgrade your yarn to 1.22.17.

K3TH3R commented 2 years ago

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 yarn as well and the notices actually disappeared for me when I upgraded to 1.22.17.

majilan37 commented 2 years ago

i had the same issue, just run npm install, and it will work

panaman67 commented 2 years ago

Im getting this error message with vite 2.8.5.

evanw commented 2 years ago

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

wael-fadlallah commented 2 years ago

@panaman67 same here, please let me know if you were able to fix it

KenEucker commented 2 years ago

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.

wael-fadlallah commented 2 years ago

I solved it by switching to pnpm

KenEucker commented 2 years ago

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.

Knogobert commented 2 years 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

OmgImAlexis commented 2 years ago

Same issue here, updating npm, deleting the node_modules and then doing a npm i got me back up and running.

uesleisuptitz commented 2 years ago

yarn global install esbuild

yarn global add esbuild, no yarn global install

IanVS commented 2 years ago

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.

justingolden21 commented 2 years ago

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 npm i to auto fix the package lock.

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 npm i to get the latest packages while still keeping the other stuff, and saw there's a diff in the package json after that, and pushed the diff.

It now builds on netlify with no errors for me.

Profesor08 commented 2 years ago

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. Because npm install will install packages listed in package-lock.json, it will not install required for linux platform package esbuild-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. Removing node_modules is some kind of monkey patching. Removing package-lock.json can be bad idea too.

lasamarndi1994 commented 2 years ago

Delete the node_modules folder and install one more time.

harrisoncramer commented 2 years ago

This happened to us because Netlify was caching a bad version of the ESBuild dependency, running their "clear cache and retry" worked.

blockscoped commented 2 years ago

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 of npm 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?

evanw commented 2 years ago

Wonder if it's possible to install for multiple archs?

This is in the getting started documentation:

If you are installing with Yarn, you can try listing both this platform and the other platform in your .yarnrc.yml file using the supportedArchitectures feature. Keep in mind that this means multiple copies of esbuild will be present on the file system.

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.

Octagon-simon commented 1 year ago

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

IanVS commented 1 year ago

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

jawadzaib commented 1 year ago

I've fixed this issue by installing npm packages using npm ci

capybarahero commented 1 year ago

Deleting the package-lock.json and running npm rebuild then npm install was sufficient to solve the issue for me.

sostene12 commented 1 year ago

i'm facing the same error, i work in the team and we use different OS, and i use MAC with Vite

pabloimrik17 commented 1 year ago

Any final fix or core reason behind this error?

multivoltage commented 1 year ago

I have same issue but with "error" instead "info" in my mac

APWHY commented 1 year ago

npm ci worked for me. I did also update node from v18 to v21, but I'm not sure that is relevant

auliayaya commented 10 months ago

yarn add --optional @esbuild/linux-x64

it work for me, to do this on building dockerfile

xcong4328 commented 5 months ago

In my development team, we encountered this error. The reason is: the same project, there are many operating systems developed together. for example macos intel, macos arm, windows. Every time members commit code, they will assign a certain esbuild version corresponding to that member's OS version to the package-lock.json file. So we added package-lock.json to the .gitignore file, and the problem was solved

multivoltage commented 5 months ago

@xcong4328 the CI used to install with npm ci or yarn install --frozen-lock-file because the project needa to install specific version locked. With you solution you lost this behavior. Is it safe?

eric-burel commented 4 months ago

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.

gabriel-arghire-tapptitude commented 3 weeks ago

What fixed for me was to add this package as an optional dependency in the package.json

"optionalDependencies": {
        "@esbuild/linux-x64":"0.24.0"
    }