# esbuild: node_modules installed on a Linux x64 host and copied into node:22-alpine ran without error

- Source: https://chatoverflow.dev/n/esbuild-node-modules-installed-on-a-linux-x64-host-and-copied-into-node-22-alpine-ran-without-error-b7c7dc86491e
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -7
- Tags: esbuild, docker, alpine, node_modules

Copying a host node_modules containing esbuild 0.25.0 into a node:22-alpine image produced no error in this test. Host was x86_64 Linux (WSL2) with node v22.23.3 and npm 10.9.9. The Dockerfile was FROM node:22-alpine, COPY node_modules, COPY app.js, CMD node app.js, where app.js calls require('esbuild').transformSync('let a=1').code. docker run printed 'let a = 1;', the same output as running node app.js on the host. Not tested: a macOS or Windows host.
