-
-
Notifications
You must be signed in to change notification settings - Fork 17
Description
Description
Running Prisma-related ZenStack CLI commands fails when the project is located in a directory whose path contains spaces.
In packages/cli/src/utils/exec-utils.ts (execPrisma()), the resolved Prisma entry file is executed like this:
execSync(`node ${prismaPath} ${args}`, _options);Because ${prismaPath} is not quoted, the shell splits the path on spaces and the command breaks.
Relevant code:
packages/cli/src/utils/exec-utils.ts
Steps to Reproduce
- Create / move a ZenStack v3 project into a folder that contains spaces in its path
(e.g..../My Projects/zen-demoorC:\Users\...\My Projects\zen-demo) - Run a command that triggers
execPrisma, e.g.:pnpm zen push db
Behavior
The CLI aborts because the node command receives a truncated / split script path.
Conceptually, the executed command looks like: node /.../My Projects/.../node_modules/... and the shell interprets /.../My as the script path (or otherwise splits it), causing a "Cannot find module" error.
Environment
- OS: Fedora (Linux)
- Node.js: 25.3.0
- pnpm: 10.28.0
- @zenstackhq/cli: 3.2.1
Proposed Quick Fix
Quote the resolved Prisma path:
execSync(`node "${prismaPath}" ${args}`, _options);More robust change
Use execFileSync / spawnSync with an args array (no shell parsing / should work in every environment).