Running wasp db migrate-dev (installed via npm install -g @wasp.sh/wasp-cli@0.17) fails with:
Setting up database...
wasp-bin: npm: readCreateProcessWithExitCode: chdir: invalid argument (Bad file descriptor)
Originally reported as a WSL2-specific issue, but it reproduces on any Linux environment using the npm-installed Wasp CLI v0.17.2.
The published npm package @wasp.sh/wasp-cli-linux-x64-glibc@0.17.2 is missing the data/packages/ directory. This directory contains built TypeScript sub-packages (prisma, deploy, ts-inspect, studio, wasp-config) that the Haskell binary needs at runtime.
The error occurs during the "Setting up database..." phase:
Wasp.Psl.Format.prismaFormatcallsNodePackageFFI.getPackageProcessOptions PrismaPackage- This calls
ensurePackageDependenciesAreInstalled, which runsnpm installwithcwdset to$waspc_datadir/packages/prisma/ - That directory does not exist in the npm package —
data/only containsCli/,Generator/, andLsp/ - Haskell's
readCreateProcessWithExitCodetries tochdirinto the non-existent directory →EBADF
You can verify the directory is missing:
npm pack @wasp.sh/wasp-cli-linux-x64-glibc@0.17.2
tar -tzf wasp.sh-wasp-cli-linux-x64-glibc-0.17.2.tgz | grep packages/
# (no output — zero files under packages/)The files are declared in waspc.cabal (data-files lines 61–79, e.g. packages/prisma/dist/**/*.js) and are supposed to be included by tools/make_binary_package.sh via cabal sdist --list-only. They were either not built or not captured when the 0.17.2 npm tarball was assembled.
docker build --platform linux/amd64 -f Dockerfile.repro -t wasp-repro .
docker run --rm wasp-repro bash -c '
wasp new testapp 2>&1 && \
cd testapp && \
wasp db migrate-dev 2>&1
'The compilation phase (npm install for the project) succeeds. The error appears at "Setting up database...".
Install Wasp via the shell installer instead of npm:
curl -sSL https://get.wasp.sh/installer.sh | sh -s -- -v 0.17.2The shell installer distributes tarballs from GitHub Releases, which include the complete data/packages/ directory.