BuilderIO / mitosis

Write components once, run everywhere. Compiles to React, Vue, Qwik, Solid, Angular, Svelte, and more.
https://mitosis.builder.io
MIT License
11.84k stars 512 forks source link

Installation not working on windows #1444

Open Giuliano1993 opened 1 month ago

Giuliano1993 commented 1 month ago

I am interested in helping provide a fix!

Yes

Which generators are impacted?

Reproduction case

.

Expected Behaviour

When running the command npm run start inside the library folder it should start watching files and generating components for the single frameworks

Actual Behaviour

This does not happens on windows since it results in the following error:

PS C:\Users\giuli\Desktop\projects\ccc\library> npm run start

> start
> watch 'npm run build' ./src

> Watching run
> Watching build'
> Watching ./src
C:\Users\giuli\Desktop\projects\ccc\node_modules\watch\main.js:73
    if (err) throw err;
             ^

[Error: ENOENT: no such file or directory, stat 'C:\Users\giuli\Desktop\projects\ccc\library\run'] {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'stat',
  path: 'C:\\Users\\giuli\\Desktop\\projects\\ccc\\library\\run'
}

Node.js v20.13.1
npm ERR! Lifecycle script `start` failed with error:
npm ERR! Error: command failed
npm ERR!   in workspace: @ccc/library
npm ERR!   at location: C:\Users\giuli\Desktop\projects\ccc\library

Additional Information

Turns out that the problem is in the packaje.json start script that uses single quotes for the command npm run build. In windows terminal that does not work. The problem can be fixed by replacing the single quotes with escaped double quotes. I'm wishing to open a PR to fix this.