Skip to content

Windows install/dev fails because @openuidev/cli build:templates uses Unix shell commands #597

@vishxrad

Description

@vishxrad

Description

Running pnpm i on Windows fails during the @openuidev/cli prepare step.

The failure happens in packages/openui-cli/package.json:

"build:templates": "rm -rf dist/templates/openui-chat && mkdir -p dist/templates && cp -R src/templates/openui-chat dist/templates/openui-chat"

This script uses Unix shell commands (rm -rf, mkdir -p, cp -R) which are not available in Windows PowerShell/CMD.

Reproduction

Environment:

  • OS: Windows
  • Shell: PowerShell / CMD
  • Package manager: pnpm

Steps:

git clone https://github.com/thesysdev/openui
cd openui
pnpm i

Actual result

Install fails with:

packages/openui-cli prepare$ pnpm run build
$ pnpm run build:cli && pnpm run build:templates
$ tsc -p .
$ rm -rf dist/templates/openui-chat && mkdir -p dist/templates && cp -R src/templates/openui-chat dist/templates/openui-chat
'rm' is not recognized as an internal or external command,
operable program or batch file.
[ELIFECYCLE] Command failed with exit code 1.

There are also earlier warnings like:

Failed to create bin at ...\node_modules\.bin\openui.
ENOENT: no such file or directory, stat '...\packages\openui-cli\dist\index.js.EXE'

which seem related to the CLI build not completing successfully.

Expected result

pnpm i should complete successfully on Windows.

Also, the docs dev server should be runnable with:

pnpm --filter @openuidev/docs dev

but this currently depends on @openuidev/cli building successfully.

Suggested fix

Make build:templates cross-platform.

Possible options:

  1. Use a Node script to copy the templates.
  2. Use cross-platform packages like rimraf and shx.
  3. Avoid Unix-specific shell commands in package scripts.

For example:

"build:templates": "rimraf dist/templates/openui-chat && shx mkdir -p dist/templates && shx cp -R src/templates/openui-chat dist/templates/openui-chat"

or better, replace it with a small Node script using fs.cpSync.


The cleanest fix is probably a small Node script, because then the repo does not depend on shell behavior at all.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workinggood first issueGood for newcomershelp wantedExtra attention is needed

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions