Svelte-Electron: 执行命令 “yarn run dev” 时发生错误。

huangapple go评论67阅读模式
英文:

Svelte-Electron: Error occurred when executing command: yarn run dev

问题

我使用 https://github.com/soulehshaikh99/create-svelte-electron-app 上的模板,一切都运行正常一段时间。几天来一直正常开发,但当我重新启动电脑/vs code 时,命令 npm run electron-dev(concurrently "yarn run dev" "yarn run electron")突然不起作用。

错误消息如下:

[0] 执行命令时发生错误:yarn run dev
[0] 错误:spawn cmd.exe ENOENT
[0]     at ChildProcess._handle.onexit (node:internal/child_process:283:19)
[0]     at onErrorNT (node:internal/child_process:476:16)
[0]     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[1] 执行命令时发生错误:yarn run electron
[1] 错误:spawn cmd.exe ENOENT
[1]     at ChildProcess._handle.onexit (node:internal/child_process:283:19)
[1]     at onErrorNT (node:internal/child_process:476:16)
[1]     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[1] yarn run electron 以代码 -4058 退出
[0] yarn run dev 以代码 -4058 退出

我尝试使用 yarn/npm 重新安装,出现一些错误依赖,但我能够解决它们。然而,上述错误仍然发生。

英文:

I use template from https://github.com/soulehshaikh99/create-svelte-electron-app , and it works just fine for a while. Been normally developing for days, but when I restart my computer/vs code, the command npm run electron-dev (concurrently "yarn run dev" "yarn run electron") suddenly not working.

The error messages are:

[0] Error occurred when executing command: yarn run dev
[0] Error: spawn cmd.exe ENOENT
[0]     at ChildProcess._handle.onexit (node:internal/child_process:283:19)
[0]     at onErrorNT (node:internal/child_process:476:16)
[0]     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[1] Error occurred when executing command: yarn run electron
[1] Error: spawn cmd.exe ENOENT
[1]     at ChildProcess._handle.onexit (node:internal/child_process:283:19)
[1]     at onErrorNT (node:internal/child_process:476:16)
[1]     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[1] yarn run electron exited with code -4058
[0] yarn run dev exited with code -4058

I tried to reinstall with yarn/npm, there are some error dependencies, but I was able to resolve them. Yet, the error above still occurred.

What is this error?

答案1

得分: 1

错误表示系统因某种原因无法找到cmd.exe

首先,尝试重新启动计算机,有时这是此类型错误的解决方法。

如果这不起作用,请检查cmd.exe的变量路径,通常应该指向C:\Windows\system32,如果它没有指向cmd.exe,则需要找到它并更改变量以指向它。

英文:

The error indicates that the system can't find the cmd.exe for some reason.

first, try restarting your computer, sometimes it is the solution for this type of error.

if that didn't work check the variable path for your cmd.exe, normally should point at C:\Windows\system32, so if it is not pointing at the cmd.exe you will have to find it and change the variable to point at it.

huangapple
  • 本文由 发表于 2023年5月14日 19:50:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76247328.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定