incomprehensible error
I'm trying to build a project on FreeBSD arm64 and I'm greeted with this incomprehensible error:
Error:
You installed esbuild for another platform than the one you're currently using.
This won't work because esbuild is written with native code and needs to
install a platform-specific binary executable.
Specifically the "@esbuild/freebsd-arm64" package is present but this platform
needs the "@esbuild/freebsd-arm64" package instead. People often get into this
situation by installing esbuild on Windows or macOS and copying "node_modules"
into a Docker image that runs Linux, or by copying "node_modules" between
Windows and WSL environments.
Unless @esbuild/freebsd-arm64 != @esbuild/freebsd-arm64 I don't see the problem.
Thank you for the report. I think this is the first time that this has come up.
From looking at node-platform.ts: This message happens when require.resolve('@esbuild/freebsd-arm64') throws an error but require.resolve('esbuild') doesn't, and then the path for esbuild joined with ../@esbuild/freebsd-arm64 exists. Unfortunately the error thrown by require.resolve is not logged in this case.
Some thoughts:
-
I wonder why in your case
require.resolve('@esbuild/freebsd-arm64')throws an error butrequire.resolve('esbuild')doesn't. Any idea why that might happen? -
Did you install esbuild in any way other than by installing a normal build of node from https://nodejs.org/en/download and then using npm to install esbuild? I ask because some people try to repackage esbuild without coordinating with me and then mess up esbuild's installer (this happened with Arch Linux, for example).
-
Is there any way I can reproduce this myself?