Comments (6)
Please read the “getting started” instructions: https://esbuild.github.io/getting-started/#simultaneous-platforms
from esbuild.
Yeah but the install process on M1 still adds a arm specific package to the package.json which will cause an error on x64.
from esbuild.
You cannot install esbuild on one OS, copy the node_modules
directory to another OS without reinstalling, and then run esbuild on that other OS. This won't work because esbuild is written with native code and needs to install a platform-specific binary executable. Normally this isn't an issue because you typically check your package.json
file into version control, not your node_modules
directory, and then everyone runs npm install
on their local machine after cloning the repository.
However, people sometimes get into this situation by installing esbuild on Windows or macOS and copying their node_modules
directory into a Docker image that runs Linux, or by copying their node_modules
directory between Windows and WSL environments. The way to get this to work depends on your package manager:
-
npm/pnpm: If you are installing with npm or pnpm, you can try not copying the
node_modules
directory when you copy the files over, and runningnpm ci
ornpm install
on the destination platform after the copy. Or you could consider using Yarn instead which has built-in support for installing a package on multiple platforms simultaneously. -
Yarn: If you are installing with Yarn, you can try listing both this platform and the other platform in your
.yarnrc.yml
file using thesupportedArchitectures
feature. Keep in mind that this means multiple copies of esbuild will be present on the file system.
You can also get into this situation on a macOS computer with an ARM processor if you install esbuild using the ARM version of npm but then try to run esbuild with the x86-64 version of node running inside of Rosetta. In that case, an easy fix is to run your code using the ARM version of node instead, which can be downloaded here: https://nodejs.org/en/download/.
Another alternative is to use the esbuild-wasm
package instead, which works the same way on all platforms. But it comes with a heavy performance cost and can sometimes be 10x slower than the esbuild
package, so you may also not want to do that.
from esbuild.
Yeah sure, we are not copying the the node modules. We use git, and the node modules are ignored. But as soon as one ran npm i
on an arm mac, the esbuild-darwin-arm64
package appears in the dev dependencies of the package json. This can't be intended, as it causes an error when trying to install the project on another platform. Shouldn't esbuild
be added to to the dev dependencies, so it can install the right binary on each system? There should not be platform specific modules in the package.json.
Sorry for bothering you with this.
from esbuild.
Shouldn't esbuild be added to to the dev dependencies,
Yes it should be esbuild
in devDependencies
. Maybe there's some custom install script that adds platform specific esbuild variant to your package.json. You need to debug that for yourself.
from esbuild.
Ok thanks.
from esbuild.
Related Issues (20)
- `esnext` target doesn't transform using declarations but `es2022` does HOT 2
- Default exports not handled correctly when external=true and module is dynamically imported (node16)
- Is there a problem here? does this make sense? HOT 4
- Glob-style imports with partial directory name substitutions
- Option to assign default export to globalName for iife format HOT 3
- Running esbuild under npm explore no longer works HOT 1
- esbuild not work well with package.json has "exports:{"./*": "./*"}" HOT 2
- Allow destructuring for all target environments HOT 1
- re-create package.json with only externalized dependencies
- SyntaxError: The requested module X does not provide an export named Y since code modification HOT 1
- CSS media query range syntax not downleveled
- Object rest and function scope HOT 4
- DCE doesn't remove unreferenced `new Regexp`. HOT 1
- CVE-2023-45288 HOT 3
- Throwing an error within a plugin does not stop the build
- Metafile not output to the `outdir` HOT 2
- Output is incorrect when there is an import declaration with an import clause that has one type only import specifier HOT 3
- invalid code generation HOT 3
- Building on top of esbuild Analyze HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esbuild.