Launching Vue UI throws error: spawn cmd ENOENT - node.js

When in cmd and I use the 'vue ui' command I get this error:
events.js:288
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:8000' ]
}
I've made sure node and vue are both up to date and have uninstalled/reinstalled both to be sure there wasn't something wrong there. Any help would be greatly appreciated. If you need more info please let me know.

You should add C:\Windows\System32 folder to you environment variables

Related

Error trying to execute react frontend (linked to backend)

I have recently tried to deploy a app consisting of react frontend and node backend on a linux machine.
While executing the frontend i got the following error:
(I used the command npm start)
node:events:491
throw er; // Unhandled 'error' event
^
Error: spawn xdg-open ENOENT
at ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess._handle.onexit (node:internal/child_process:289:12)
at onErrorNT (node:internal/child_process:476:16)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn xdg-open',
path: 'xdg-open',
spawnargs: [ 'http://localhost:3000' ]
}
Node.js v18.12.1

Node JS Error: spawn node-7z-forall/binaries/linux/7za ENOENT

I am using the module node-7z-forall and tried to extract a file. and ending with below error
{ Error: spawn <project-path>/node_modules/node-7z-forall/binaries/linux/7za ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
errno: 'ENOENT',
code: 'ENOENT',
syscall:
'spawn <project-path>/node_modules/node-7z-forall/binaries/linux/7za',
path:
'<project-path>/node_modules/node-7z-forall/binaries/linux/7za',
spawnargs:
[ 'x',
'/tmp/QMTH1648468809779.zip',
'-o/tmp/QMTH1648468809779',
'-pkarnatakaBank',
'-ssc',
'-y',
'-bb2' ] }
please help me on this
Hi I found the solution for my problem:
Some dependencies were not installed properly. Removed the existing module and reinstalled again. and it worked for me.

Why won't zsh run npm scripts

My default SHELL is zsh, when I run npm start inside react folder it doesn't seem to work,
Starting the development server...
node:events:371
throw er; // Unhandled 'error' event
^
Error: spawn brave ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83: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:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn brave',
path: 'brave',
spawnargs: [ 'http://localhost:3001' ]
}
On the other hand, if I use the bash terminal or vs terminal (bash kind) it does work properly

npx create-express-api keeps getting unknown errors

I keep getting errors on CMD when I try to use create-express-api for somewhat reasons.
Launched by git CMD:
Cloning into 'server'...
events.js:292
throw er; // Unhandled 'error' event
^
Error: spawn rm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn rm',
path: 'rm',
spawnargs: [ '-rf', 'server/.git' ]
}
Launched by Powershell:
fatal: destination path 'server' already exists and is not an empty directory.
events.js:292
throw er; // Unhandled 'error' event
^
Error: spawn rm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn rm',
path: 'rm',
spawnargs: [ '-rf', 'server/.git' ]
}
I have downloaded all the softwares & control systems that make running the package, npm, npx, git and also downloaded npm i create-express-api.
npm -v: 6.14.6
npx -v: 6.14.6
git --version: git version 2.28.0.windows.1
Why can't I use the package by using npx command?
Any solutions?
So I've tried in my machine... I do the following:
npx create-express-api name-of-app
And everything goes right. I could open the folder name-of-app and ran npm run dev and worked
Another try is install global and run:
npm install -g create-express-api
create-express-api name-of-app
The last way is to clone the repository manually and install its dependencies
git clone https://github.com/w3cj/express-api-starter.git server
cd server
npm install

live-server not opening up the website automatically

I installed node.js, and "npm install -g live-server"
After that the input of "live-server" in the command line prompt should open up the website that is situated in the current folder, but every time I try to do that, this shows up:
Serving "C:\Users\AAYUSHI\bg-gen" at http://127.0.0.1:8080
events.js:288
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) Emitted 'error' event on
ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) { errno: 'ENOENT', code:
'ENOENT', syscall: 'spawn cmd', path: 'cmd', spawnargs: [ '/c',
'start', '""', '/b', 'http://127.0.0.1:8080' ] }
No browser opens up my website automatically.
What do you think is the problem?
I checked system variables one more time and found the cause of the problem: missing C:\Windows\System32\ variable. I added it and that solved my problem
Hope, it help you too.
Most likely issue with opening the browser. Use this option instead:
live-server dist --port=3000 --no-browser

Resources