while installing scanity Error: spawn cmd ENOENT - node.js

⠋ Waiting for browser login to complete... Press Ctrl + C to cancelnode:events:505
throw er; // Unhandled 'error' event
^
Error: spawn cmd 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 cmd',
path: 'cmd',
spawnargs: [
'/c',
'start',
'""',
'/b',
'https://api.sanity.io/v1/auth/login/github?type=listen^&uuid=9b8a14a23276e73608528a6408902f44^&source=cli'
]
}

Add C:\Windows\System32 to the PATH environment variable.

Related

I got an error like this to create a project(Vue.js) using the GUI

Starting GUI...
🌠 Ready on http://localhost:8000
node:events:368
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit
(node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:475: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:475:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:8000' ]
}
Node.js v17.2.0

Just started new project and when I run npm run dev it throws an error in the terminal

$ npm run dev
vite-project#0.0.0 dev
vite
node:events:346
throw er; // Unhandled 'error' event
^
Error: spawn C:\Users\cottamcha\Desktop\Code\portforlio\vite-project\node_modules\esbuild\esbuild.exe 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 C:\Users\cottamcha\Desktop\Code\portforlio\vite-project\node_modules\esbuild\esbuild.exe',
path: 'C:\Users\cottamcha\Desktop\Code\portforlio\vite-project\node_modules\esbuild\esbuild.exe',
spawnargs: [ '--service=0.11.23', '--ping' ]
}
Try running:
node ./node_modules/esbuild/install.js

Discord js keyv throwing ECONNREFUSED

I'm trying to use Keyv, following this tutorial: https://discordjs.guide/keyv/#command-handler and I'm using the command handler code as well.
In my index.js, I run something like this: (with the appropriate imports for Keyv of course)
const Keyv = require('keyv');
const mykeyv = new Keyv('redis://user:pass#localhost:6379');
client.on('message', message =>{
...//skipping some command handler stuff
command.execute(message, args, mykeyv)
})
And then when I run this, I initially get the correct and expected client.on('ready') messages, but then a few seconds after the following error pops up:
events.js:292
throw er; // Unhandled 'error' event
^
Error: connect ECONNREFUSED 127.0.0.1:6379
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16)
Emitted 'error' event on Keyv instance at:
at KeyvRedis.<anonymous> (C:\Users\Meroper80\Documents\GitHub\DndBot\Node-Js-Discord-Bot\node_modules\keyv\src\index.js:43:44)
at KeyvRedis.emit (events.js:315:20)
at Redis.<anonymous> (C:\Users\Meroper80\Documents\GitHub\DndBot\Node-Js-Discord-Bot\node_modules\#keyv\redis\src\index.js:17:38)
at Redis.emit (events.js:315:20)
at Redis.silentEmit (C:\Users\Meroper80\Documents\GitHub\DndBot\Node-Js-Discord-Bot\node_modules\ioredis\built\redis\index.js:499:26)
at Socket.<anonymous> (C:\Users\Meroper80\Documents\GitHub\DndBot\Node-Js-Discord-Bot\node_modules\ioredis\built\redis\event_handler.js:186:14)
at Object.onceWrapper (events.js:422:26)
at Socket.emit (events.js:315:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 6379
}
I'm not sure what this error is about, can someone help me?

When I upload image in node, it throws ENOENT error

When I upload image in node , it throws ENOENT error:
Error: spawn identify ENOENT
at _errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:372:16)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickDomainCallback (internal/process/next_tick.js:218:9)
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn identify',
path: 'identify',
spawnargs: [ '-verbose', '-' ] }

How to resolve " throw er; // Unhandled 'error' event ^ Error: spawn cp ENOENT" error?

I am trying to copy master.js into master1.js.
Getting the following error:
events.js:174
throw er; // Unhandled 'error' event
^Error: spawn cp 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)
Code for master.js
const { spawn } = require('child_process');
const child = spawn('cp',["master.js","master1.js"]);
child.on("exit",()=>{
console.log("copy finished")
})

Resources