qwik icon indicating copy to clipboard operation
qwik copied to clipboard

[🐞] Unable to install into current directory

Open Arctomachine opened this issue 2 years ago • 7 comments

Which component is affected?

Starters / CLI

Describe the bug

Related: #3901

The solution introduced to that feature request is not sufficient. Whenever I try to create new project, I get following error in console

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

[Error: EBUSY: resource busy or locked, rmdir 'C:\Users\user\projects\qwik-test'] {
  errno: -4082,
  code: 'EBUSY',
  syscall: 'rmdir',
  path: 'C:\\Users\\user\\projects\\qwik-test'
}

It looks like ide is not allowing to delete its project settings folder while running. Cannot reproduce it in online sandbox, only locally

Reproduction

It has to be reproduced locally and manually

Steps to reproduce

  1. Open ide
  2. Create new project from ide interface
  3. Run npm/yarn/pnpm create qwik@latest in terminal
  4. Select current . folder as destination
  5. Agree to overwrite it when asked
  6. Script fails with error mentioned above

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (12) x64 AMD Ryzen 5 2600 Six-Core Processor
    Memory: 12.89 GB / 23.95 GB
  Binaries:
    Node: 18.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
    npm: 8.19.3 - C:\Program Files\nodejs\npm.CMD

Additional Information

No response

Arctomachine avatar May 13 '23 09:05 Arctomachine

Seems like something is using the folder... EBUSY: resource busy or locked, rmdir

do you have any editor or something open?

manucorporat avatar May 13 '23 12:05 manucorporat

Yes, naturally

Arctomachine avatar May 13 '23 13:05 Arctomachine

The current idea works by removing the folder and creating a new one, vscode is locking the folder, so the CLI can not remove it.

This could be fixed by trying to avoid removing the folder and instead remove all the content, in here: https://github.com/BuilderIO/qwik/blob/9be6588e6ff83ed704b0d117e71ae5a434b0d51a/packages/create-qwik/create-interactive.ts#L74

Would u be up to make a PR? :)

manucorporat avatar May 13 '23 13:05 manucorporat

I can try to

Arctomachine avatar May 13 '23 14:05 Arctomachine

How can I test this script locally to see how it works with my changes?

Arctomachine avatar May 13 '23 14:05 Arctomachine

I too support for installing without deleting anything.

Arctomachine avatar May 13 '23 15:05 Arctomachine

hi 👋 thanks for having a look at it 🙏 guess it was a design decission to remove the directory and create a new one. guess we have to make sure, that in the proposed way all files are removed also hidden files to avoid other conflicts.

and yes, there is a prompt where you need to confirm the deletion atm 👍

to test the changes locally you can run pnpm cli locally.

zanettin avatar May 13 '23 18:05 zanettin

and pls let me know when u need help or i should take over 👍 thanks again for having a look at it 🙏

zanettin avatar May 13 '23 19:05 zanettin

I made a fix. Tested it, seems to be working

Arctomachine avatar May 13 '23 21:05 Arctomachine