You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+49
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,54 @@
1
1
# Changelog
2
2
3
+
## Unreleased
4
+
5
+
* Attempt to explain why esbuild can't run ([#1819](https://github.com/evanw/esbuild/issues/1819))
6
+
7
+
People sometimes try to install esbuild on one OS and then copy the `node_modules` directory over to another OS without reinstalling. This works with JavaScript code but doesn't work with esbuild because esbuild is a native binary executable. This release attempts to offer a helpful error message when this happens. It looks like this:
8
+
9
+
```
10
+
$ ./node_modules/.bin/esbuild
11
+
./node_modules/esbuild/bin/esbuild:106
12
+
throw new Error(`
13
+
^
14
+
15
+
Error:
16
+
You installed esbuild on another platform than the one you're currently using.
17
+
This won't work because esbuild is written with native code and needs to
18
+
install a platform-specific binary executable.
19
+
20
+
Specifically the "esbuild-linux-arm64" package is present but this platform
21
+
needs the "esbuild-darwin-arm64" package instead. People often get into this
22
+
situation by installing esbuild on Windows or macOS and copying "node_modules"
23
+
into a Docker image that runs Linux, or by copying "node_modules" between
24
+
Windows and WSL environments.
25
+
26
+
If you are installing with npm, you can try not copying the "node_modules"
27
+
directory when you copy the files over, and running "npm ci" or "npm install"
28
+
on the destination platform after the copy. Or you could consider using yarn
29
+
instead which has built-in support for installing a package on multiple
30
+
platforms simultaneously.
31
+
32
+
If you are installing with yarn, you can try listing both this platform and the
33
+
other platform in your ".yarnrc.yml" file using the "supportedArchitectures"
0 commit comments