Closed zeromancer closed 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"})
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
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.
I used WSL2 Ubuntu
, and I use pnpm install esbuild -g
successfully, while it couldn't build successfully.
> 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 supportedArchitectures
in .yarnrc.yml worked for me:
supportedArchitectures:
os:
- "current"
- "linux"
cpu:
- "current"
- "x64"
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 https://github.com/evanw/esbuild/issues/1646#issuecomment-1014153092 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.
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.
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
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.
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
.
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 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.
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.
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 npm i -D esbuild
Same issue here, updating npm, deleting the node_modules
and then doing a npm i
got me back up and running.
yarn global install esbuild
yarn global add esbuild, no yarn global install
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.
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.
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.
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.
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?
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.
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 npm ci
Deleting the package-lock.json
and running npm rebuild
then npm install
was sufficient to solve the issue for me.
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
npm ci
worked for me. I did also update node from v18 to v21, but I'm not sure that is relevant
yarn add --optional @esbuild/linux-x64
it work for me, to do this on building dockerfile
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
@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?
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 package.json
"optionalDependencies": {
"@esbuild/linux-x64":"0.24.0"
}
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/)