Create-react-app: unhandled error event: Events.js.187 - node.js

'm trying to create a new react app with yarn. after using the command create-react-app i keep getting an error unhandled events error. There's also a reference to django-admin.py in the error log for some reason and I can't make out the connection.Can i get some assistance. the log of the error is shown below
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
events.js:187
throw er; // Unhandled 'error' event
^
Error: spawn C:\Windows\system32\cmd.exe;C:\Users\HP\AppData\Local\Programs\Python\Python36\Scripts\django-admin.py ENOENT
[90m at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)[39m
[90m at onErrorNT (internal/child_process.js:456:16)[39m
[90m at processTicksAndRejections (internal/process/task_queues.js:80:21)[39m
Emitted 'error' event on ChildProcess instance at:
at ChildProcess.cp.emit (C:\Users\HP\AppData\Local\Yarn\Data\global\node_modules\[4mcross-spawn[24m\lib\enoent.js:34:29)
[90m at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)[39m
[90m at onErrorNT (internal/child_process.js:456:16)[39m
[90m at processTicksAndRejections (internal/process/task_queues.js:80:21)[39m {
errno: [32m'ENOENT'[39m,
code: [32m'ENOENT'[39m,
syscall: [32m'spawn C:\\Windows\\system32\\cmd.exe;C:\\Users\\HP\\AppData\\Local\\Programs\\Python\\Python36\\Scripts\\django-admin.py'[39m,
path: [32m'C:\\Windows\\system32\\cmd.exe;C:\\Users\\HP\\AppData\\Local\\Programs\\Python\\Python36\\Scripts\\django-admin.py'[39m,
spawnargs: [
[32m'/d'[39m,
[32m'/s'[39m,
[32m'/c'[39m,
[32m'"npm ^"install^" ^"--save^" ^"--save-exact^" ^"--loglevel^" ^"error^" ^"react^" ^"react-dom^" ^"react-scripts#0.9.x^""'[39m
]
}
C:\Users\HP\Documents\web dev\Angular 2>cd C:\Users\HP\Documents\web dev\Angular 2create-react-app my-app

Check that you have the following environment variables under PATH System Variables
C:\Windows\system32
C:\Windows
C:\Windows\System32\Wbem
Mine were missing for some reason but when I added them in this exact same problem vanished.

Related

Incorrect Header Check at Zlib when install package geolite2-redist

I just got this weird error and did not find a result.
Everything was still fine yesterday. But when I start reinstall my packages ( geolite2-redist) , it gives me this error:
error /home/ubuntu/node_modules/geolite2-redist: Command failed. Exit code: 1 Command: node scripts/postinstall.js Arguments: Directory: /home/ubuntu/node_modules/geolite2-redist Output: Downloading MaxMind databases from mirror... node:events:368 throw er; // Unhandled 'error' event ^ Error: incorrect header check at Zlib.zlibOnError [as onerror] (node:zlib:190:17) Emitted 'error' event on Gunzip instance at: at Gunzip.onerror (node:internal/streams/readable:773:14) at Gunzip.emit (node:events:390:28) at emitErrorNT (node:internal/streams/destroy:157:8) at emitErrorCloseNT (node:internal/streams/destroy:122:3) at processTicksAndRejections (node:internal/process/task_queues:83:21) {
Have anyone got this error like me before ?

Vue 3 returns an error after running my project and compiling it with npm run dev

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

Error: write EPIPE on nextJs (11.1.0) build

I am trying to create my app build on nextJs (v11.1.0), Webpack (5.30.0) with yarn PnP but 99% of the times my build fails with the following error:
throw er; // Unhandled 'error' event
^
Error: write EPIPE
at ChildProcess.target._send (internal/child_process.js:839:20)
at ChildProcess.target.send (internal/child_process.js:710:19)
at ChildProcessWorker.initialize (/tmp/.yarn/__virtual__/jest-worker-virtual-0fce01769d/0/cache/jest-worker-npm-27.0.0-next.5-6f53fab806-d56bfe67cd.zip/node_modules/jest-worker/build/workers/ChildProcessWorker.js:181:11)
at ChildProcessWorker._onExit (/tmp/.yarn/__virtual__/jest-worker-virtual-0fce01769d/0/cache/jest-worker-npm-27.0.0-next.5-6f53fab806-d56bfe67cd.zip/node_modules/jest-worker/build/workers/ChildProcessWorker.js:275:12)
at ChildProcess.emit (events.js:400:28)
at ChildProcess.emit (domain.js:470:12)
at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
Emitted 'error' event on ChildProcess instance at:
at internal/child_process.js:843:39
at processTicksAndRejections (internal/process/task_queues.js:77:11) {
errno: -32,
code: 'EPIPE',
syscall: 'write'
I am confused as to why the jest worker is active on build time.

yarn/npm start gives permission error with local dev server create-react-app

Whenever I try to start the development server, I have to do so with sudo yarn start.
This is obviously not preferable.
If I do it without sudo, I get the following error:
Starting the development server...
node:events:368
throw er; // Unhandled 'error' event
^
Error: spawn firedragon 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 firedragon',
path: 'firedragon',
spawnargs: [ 'http://localhost:3001' ]
}
I tried changing permissions of npm binaries in /usr/bin/ and got myself into a whole sudo permissions debacle that I thankfully got myself out of.
I also tried to wipe every trace of yarn, npm, and node from my machine and reinstalled everything to no avail.
If anyone has any answers, please, I could use your help.
Downgrade with this command: npm install react-scripts#2.1.8

Error: spawn ngr ENOENT

I am totally unaware of this kind of error,
whats the causing this error how can I solve it?
cross-env NODE_ENV=development ngr build dev
Console Error.
events.js:165
throw er; // Unhandled 'error' event
^
Error: spawn ngr ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:201:19)
at onErrorNT (internal/child_process.js:379:16)
at process._tickCallback (internal/process/next_tick.js:114:19)
at Function.Module.runMain (module.js:692:11)
at startup (bootstrap_node.js:194:16)
at bootstrap_node.js:666:3
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:207:12)
at onErrorNT (internal/child_process.js:379:16)
[... lines matching original stack trace ...]
at bootstrap_node.js:666:3

Resources