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:
- Use a Node script to copy the templates.
- Use cross-platform packages like
rimraf and shx.
- 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.
Description
Running
pnpm ion Windows fails during the@openuidev/cliprepare step.The failure happens in
packages/openui-cli/package.json:This script uses Unix shell commands (
rm -rf,mkdir -p,cp -R) which are not available in Windows PowerShell/CMD.Reproduction
Environment:
Steps:
Actual result
Install fails with:
There are also earlier warnings like:
which seem related to the CLI build not completing successfully.
Expected result
pnpm ishould complete successfully on Windows.Also, the docs dev server should be runnable with:
but this currently depends on
@openuidev/clibuilding successfully.Suggested fix
Make
build:templatescross-platform.Possible options:
rimrafandshx.For example:
or better, replace it with a small Node script using
fs.cpSync.