RubricLab / create-rubric-app

CLI tool to get started with a full-stack AI project.
https://todo.rubric.sh
Other
138 stars 9 forks source link

Issue - npx create-rubric-app@latest failing in Windows 11 during project bootstrap #2

Closed saliksik closed 1 year ago

saliksik commented 1 year ago

Issue Description:

While using npx create-rubric-app@latest to bootstrap a new Next.js project on Windows 11, I encountered an error upon setup. I am being prompted with the options to "scaffold project files, download assets, configure vscode, configure DB, run install, run dev," but the process does not complete successfully.

Instead, it stalls at the second step "✅ 1/6 - Scaffolded project files" and throws an error 'cp' is not recognized as an internal or external command. Below is the detailed error I get:

'cp' is not recognized as an internal or external command,
operable program or batch file.
node:internal/errors:866
  const err = new Error(message);
              ^

Error: Command failed: cd todo-1 && cp .env.example .env && echo sk-vp5FlPMkqHMmNLKR2OSzXXXXXX >> .env && mv gitignore .gitignore && git init -b main
    at checkExecSyncError (node:child_process:890:11)
    at Object.execSync (node:child_process:962:15)
    at file:///C:/Users/XXXXX/AppData/Local/npm-cache/_npx/938b4f2cd598e4a3/node_modules/create-rubric-app/index.mjs:203:16
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 15800,
  stdout: null,
  stderr: null
}

I'm using Node.js v20.8.0

This seems to be related to the Windows operating system and its lack of built-in support for Unix-based utilities like 'cp'.

A potential solution might be for the create-rubric-app script to determine the user's operating system and issue the appropriate commands accordingly. For instance, in Windows, the 'cp' utility equivalent could be 'copy' or 'xcopy' and 'mv' could be replaced with 'ren' or 'move'.

DexterStorey commented 1 year ago

Shoot! Good catch. Thanks so much for this @saliksik. We'll have to add support for a Windows-friendly alternative to cp - I think copy? In the meantime if you're eager to try it out - you could clone this

I added instructions in the README to port it to a local db - let me know if you have any questions!

DexterStorey commented 1 year ago

Hey @saliksik can you test npx create-rubric-app@latest? In theory windows should now be supported thanks to @arihanv If it works, we can close this issue.

DexterStorey commented 1 year ago

Maige label this

DexterStorey commented 1 year ago

Maige label this

tedspare commented 1 year ago

Heyo @saliksik! Would you have another chance to test this? #13 hopefully fixed it.