Error to serve when we have space in project directory (Windows)
deka opened this issue · comments
Nothing I can do with your info.
OS : Windows 10
Steps to reproduce :
- download source code
- add space in project directory : d:/sources/vue-cli-plugin-vite-main\vue-cli-plugin-vite-main\e x a m p l e s\my-spa-js-app
- /> yarn
- /> yarn vite
`node:events:355
throw er; // Unhandled 'error' event
^
Error: spawn vite ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:480:16)
at processTicksAndRejections (node:internal/process/task_queues:81:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
at onErrorNT (node:internal/child_process:480:16)
at processTicksAndRejections (node:internal/process/task_queues:81:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn vite',
path: 'vite',
spawnargs: [
'--config',
'D:\sources\vue-cli-plugin-vite-main\vue-cli-plugin-vite-main\config\index.ts'
]
}`
sorry wont fix. you should remove space.
???
In my case i can't remove space.
paths with spaces are common in windows.
Regards
https://www.npmjs.com/package/cross-spawn
maybe you can use it in bin/vite
Can you give me feedback, I will release new version if it works.
Hi,
cross-spawn works
In bin/vite :
const { spawn } = require('spawn')
const { spawn } = require('cross-spawn')
Regards
hi, I'm try using this repo commit:c5bd5efa9d9567e87465faac4684f7ecf0b4aa12
under windows11.
The project name content '-' cause 'Error spawn vite ENOENT '. finally it worked. However, when I click the button, it stopped.
PS D:\code\tem\example> yarn vite
yarn run v1.22.10
$ set USE_VITE=true && node ./bin/vite
running: vite --config D:\code\tem\example\node_modules\vue-cli-plugin-vite\config\index.ts
vite v2.5.1 dev server running at:
> Local: http://localhost:9527/
> Network: use `--host` to expose
ready in 3355ms.
Loading Vetur in workspace path: D:\code\tem\example
node:internal/event_target:641
process.nextTick(() => { throw err; });
^
Error: Unhandled method window/showMessageRequest
at handleResponse (D:\code\tem\example\node_modules\vscode-jsonrpc\lib\common\connection.js:477:48)
at processMessageQueue (D:\code\tem\example\node_modules\vscode-jsonrpc\lib\common\connection.js:292:17)
at Immediate.<anonymous> (D:\code\tem\example\node_modules\vscode-jsonrpc\lib\common\connection.js:276:13)
at processImmediate (node:internal/timers:464:21)
Emitted 'error' event on Worker instance at:
at Worker.[kOnErrorMessage] (node:internal/worker:297:10)
at Worker.[kOnMessage] (node:internal/worker:308:37)
at MessagePort.<anonymous> (node:internal/worker:211:57)
at MessagePort.[nodejs.internal.kHybridDispatch] (node:internal/event_target:461:20)
at MessagePort.exports.emitMessage (node:internal/per_context/messageport:23:28) {
code: -32601,
data: undefined
}
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@hellorayza sorry dont have windows PC…