vikejs / bati

Next-gen scaffolder. Get started with fully-functional apps, and choose any tool you want.
https://batijs.dev
MIT License
279 stars 14 forks source link

[Powershell] "UI Framework is required" despite defined UI selection #414

Closed Spown closed 3 weeks ago

Spown commented 3 weeks ago

> npm create bati -- --vue --tailwindcss --authjs --ts-rest --express --prisma --google-analytics --eslint --sentry

yields:

> npx
> create-bati

⚠ A UI Framework is required when using Bati. Choose one of --react, --vue, or --solid
npm error code 5
npm error path XXX
npm error command failed
npm error command C:\Windows\system32\cmd.exe /d /s /c create-bati
npm error A complete log of this run can be found in: %USER%\AppData\Local\npm-cache\_logs\2024-10-27T22_51_53_043Z-debug-0.log

Additional context

0 verbose cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
1 info using npm@10.9.0
2 info using node@v22.10.0
3 silly config load:file:%USER%\AppData\Roaming\nvm\v22.10.0\node_modules\npm\npmrc
4 silly config load:file:XXX\.npmrc
5 silly config load:file:%USER%\.npmrc
6 silly config load:file:C:\Program Files\nodejs\etc\npmrc
7 verbose title npm create bati
8 verbose argv "create" "bati" "--vue" "--tailwindcss" "--authjs" "--ts-rest" "--express" "--prisma" "--google-analytics" "--eslint" "--sentry"
9 verbose logfile logs-max:10 dir:%USER%\AppData\Local\npm-cache\_logs\2024-10-27T22_51_53_043Z-
10 verbose logfile %USER%\AppData\Local\npm-cache\_logs\2024-10-27T22_51_53_043Z-debug-0.log
11 silly logfile start cleaning logs, removing 1 files
12 silly logfile done cleaning log files
13 silly packumentCache heap:2197815296 maxSize:549453824 maxEntrySize:274726912
14 http fetch GET 200 https://registry.npmjs.org/create-bati 745ms (cache revalidated)
15 silly packumentCache heap:2197815296 maxSize:549453824 maxEntrySize:274726912
16 verbose stack Error: command failed
16 verbose stack     at promiseSpawn (%USER%\AppData\Roaming\nvm\v22.10.0\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:22:22)
16 verbose stack     at spawnWithShell (%USER%\AppData\Roaming\nvm\v22.10.0\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:124:10)
16 verbose stack     at promiseSpawn (%USER%\AppData\Roaming\nvm\v22.10.0\node_modules\npm\node_modules\@npmcli\promise-spawn\lib\index.js:12:12)
16 verbose stack     at runScriptPkg (%USER%\AppData\Roaming\nvm\v22.10.0\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script-pkg.js:77:13)
16 verbose stack     at runScript (%USER%\AppData\Roaming\nvm\v22.10.0\node_modules\npm\node_modules\@npmcli\run-script\lib\run-script.js:9:12)
16 verbose stack     at run (%USER%\AppData\Roaming\nvm\v22.10.0\node_modules\npm\node_modules\libnpmexec\lib\run-script.js:48:10)
16 verbose stack     at async exec (%USER%\AppData\Roaming\nvm\v22.10.0\node_modules\npm\node_modules\libnpmexec\lib\index.js:298:10)
16 verbose stack     at async Init.execCreate (%USER%\AppData\Roaming\nvm\v22.10.0\node_modules\npm\lib\commands\init.js:135:5)
16 verbose stack     at async Init.exec (%USER%\AppData\Roaming\nvm\v22.10.0\node_modules\npm\lib\commands\init.js:44:14)
16 verbose stack     at async Npm.exec (%USER%\AppData\Roaming\nvm\v22.10.0\node_modules\npm\lib\npm.js:207:9)
17 error code 5
18 error path XXX
19 error command failed
20 error command C:\Windows\system32\cmd.exe /d /s /c create-bati
21 verbose cwd XXX
22 verbose os Windows_NT 10.0.22631
23 verbose node v22.10.0
24 verbose npm  v10.9.0
25 verbose exit 5
26 verbose code 5
27 error A complete log of this run can be found in: %USER%\AppData\Local\npm-cache\_logs\2024-10-27T22_51_53_043Z-debug-0.log

image

magne4000 commented 3 weeks ago

This seems to be a known bug of npm cli with powershell. The workaround is to replace the first -- with --- like so:

npm create bati --- --vue --tailwindcss --authjs --ts-rest --express --prisma --google-analytics --eslint --sentry
magne4000 commented 3 weeks ago

I'm closing the issue for now. If I see other issues regarding powershell+npm usage, I'll have to update the Web UI accordingly.

magne4000 commented 3 weeks ago

Nevermind, --- also works on linux, so I'll just update the UI accordingly