arco-design / arco-cli

CLI tool for Arco Design
https://arco.design/docs/material/guide
MIT License
203 stars 76 forks source link

Cli can't create Vue project on Windows #90

Open Gaojianli opened 2 months ago

Gaojianli commented 2 months ago

Describe the bug Try to create an arco pro project, and got a error.

To Reproduce Steps to reproduce the behavior:

  1. open a folder and run arco init hello-arco-pro
  2. select Arco Pro Project and Full version
  3. got this error, tried twice, reproduced with admin

Expected behavior The project was successfully created

Desktop (please complete the following information):

Additional context

⚡ Gaojianli@PC  ~\..\repos  arco init hello-arco-pro

        ___                    ____            _
       /   |  ______________  / __ \___  _____(_)___ _____
      / /| | / ___/ ___/ __ \/ / / / _ \/ ___/ / __ `/ __ \
     / ___ |/ /  / /__/ /_/ / /_/ /  __(__  ) / /_/ / / / /
    /_/  |_/_/   \___/\____/_____/\___/____/_/\__, /_/ /_/
                                             /____/

                                                v1.27.5

? The given path already exists, are you sure to overwrite it? C:\Users\Gaojianli\source\repos\hello-arco-pro
Yes
? Please select the framework you want to use Vue
? Please select the type of project you want to create Arco Pro Project
? Please choose the template of Arco Pro Full version (contains all pages)

Initializing the project at C:\Users\Gaojianli\source\repos\hello-arco-pro
✔ Get project template successfully
✖ Failed to copy template content
Error: spawnSync npm.cmd EINVAL
    at Object.spawnSync (node:internal/child_process:1124:20)
    at spawnSync (node:child_process:876:24)
    at module.exports (C:\Users\Gaojianli\.arco_template_cache\1713711581322\node_modules\arco-design-pro-vue\.arco-cli\init.js:18:31)
    at C:\Users\Gaojianli\AppData\Roaming\npm\node_modules\arco-cli\node_modules\arco-cli-create-project\lib\index.js:129:23
    at Generator.next (<anonymous>)
    at fulfilled (C:\Users\Gaojianli\AppData\Roaming\npm\node_modules\arco-cli\node_modules\arco-cli-create-project\lib\index.js:5:58)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'spawnSync npm.cmd',
  path: 'npm.cmd',
  spawnargs: [
    'run',
    'gen:vite',
    '--',
    '--projectPath=C:\\Users\\Gaojianli\\source\\repos\\hello-arco-pro'
  ]
}
Error: EBUSY: resource busy or locked, rmdir 'C:\Users\Gaojianli\.arco_template_cache\1713711581322\node_modules\arco-design-pro-vue'
node:fs:1216
  binding.rmdir(pathModule.toNamespacedPath(path));
          ^

Error: EBUSY: resource busy or locked, rmdir 'C:\Users\Gaojianli\.arco_template_cache\1713711581322\node_modules\arco-design-pro-vue'
    at Object.rmdirSync (node:fs:1216:11)
    at rmdirSync (C:\Users\Gaojianli\AppData\Roaming\npm\node_modules\arco-cli\node_modules\fs-extra\lib\remove\rimraf.js:264:13)
    at rimrafSync (C:\Users\Gaojianli\AppData\Roaming\npm\node_modules\arco-cli\node_modules\fs-extra\lib\remove\rimraf.js:243:7)
    at C:\Users\Gaojianli\AppData\Roaming\npm\node_modules\arco-cli\node_modules\fs-extra\lib\remove\rimraf.js:279:39
    at Array.forEach (<anonymous>)
    at rmkidsSync (C:\Users\Gaojianli\AppData\Roaming\npm\node_modules\arco-cli\node_modules\fs-extra\lib\remove\rimraf.js:279:26)
    at rmdirSync (C:\Users\Gaojianli\AppData\Roaming\npm\node_modules\arco-cli\node_modules\fs-extra\lib\remove\rimraf.js:269:7)
    at rimrafSync (C:\Users\Gaojianli\AppData\Roaming\npm\node_modules\arco-cli\node_modules\fs-extra\lib\remove\rimraf.js:243:7)
    at C:\Users\Gaojianli\AppData\Roaming\npm\node_modules\arco-cli\node_modules\fs-extra\lib\remove\rimraf.js:279:39
    at Array.forEach (<anonymous>) {
  errno: -4082,
  code: 'EBUSY',
  syscall: 'rmdir',
  path: 'C:\\Users\\Gaojianli\\.arco_template_cache\\1713711581322\\node_modules\\arco-design-pro-vue'
}
funte commented 2 months ago

Same problem in nodejs v20.12.2 + windows11 22h2.

xixihhhh commented 1 month ago

me too

liuwanzhen commented 1 month ago

me to

343829084 commented 1 month ago

me too

freezeChen commented 1 month ago

me too

hanzhi-hub commented 1 month ago

me too

dangweiwu commented 5 days ago

me too

343136121 commented 3 days ago

me too +10086

limaodaxia commented 2 hours ago

I also encountered this problem.