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
Related
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
Good day. I tried installing the dependencies of a Vue.JS app repository npm install.
Then, I run the Vue.JS app using npm run dev. However, after running it, it shows the following error in the terminal:
PS G:\malaysia-coronavirus> npm run dev
> malaysia-coronavirus#0.0.0 dev
> vite
node:events:504
throw er; // Unhandled 'error' event
^
Error: spawn G:\malaysia-coronavirus\node_modules\esbuild\esbuild.exe ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:478: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:289:12)
at onErrorNT (node:internal/child_process:478:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn G:\\malaysia-coronavirus\\node_modules\\esbuild\\esbuild.exe',
path: 'G:\\malaysia-coronavirus\\node_modules\\esbuild\\esbuild.exe',
spawnargs: [ '--service=0.12.15', '--ping' ]
}
How do I fix this? Did I do something wrong with the dependencies?
Are there any missing installation that I accidentally skipped?
I found a way to fix it. I just had to simply run:
node ./node_modules/esbuild/install.js
Answer from this thread: https://github.com/vitejs/vite/issues/1361#issuecomment-754442599
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
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
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