events.js 167 error in React Installation - javascript

I am trying to setup react in my PC. I have completed downloading the reacr modules and am starting to run through local server and these errors occur to me.
events.js:167
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:232:19)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:238:12)
at onErrorNT (internal/child_process.js:407:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! portfolio#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the portfolio#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\mohin\AppData\Roaming\npm-cache\_logs\2020-03-18T05_50_06_309Z-debug.log
I know it's simple error for local server and tried to open the index.html file manually then it didnot show the react logo but instead showed something like this.
Please help me through the installation.
npm install error

It was due to inconsistency in npm versions I guess. I had deleted node modules and re-installed all the modules again using npm-install.
It worked fine from then.

Related

Any Idea why vite.js is having issues in react with esbuild

I tried installing react app with vite and after installation when i tried using npm run dev it keeps throwing this error,
dyld: Symbol not found: _clock_gettime
Referenced from: /Users/KELVIN/Desktop/ZZZ/react/mobile_banking/node_modules/#esbuild/darwin-x64/bin/esbuild
Expected in: flat namespace
failed to load config from /Users/KELVIN/Desktop/ZZZ/react/mobile_banking/vite.config.js
error when starting dev server:
Error: The service was stopped
at /Users/KELVIN/Desktop/ZZZ/react/mobile_banking/node_modules/esbuild/lib/main.js:1145:25
at Object.responseCallbacks.<computed> (/Users/KELVIN/Desktop/ZZZ/react/mobile_banking/node_modules/esbuild/lib/main.js:
701:9)
at Socket.afterClose (/Users/KELVIN/Desktop/ZZZ/react/mobile_banking/node_modules/esbuild/lib/main.js:691:28)
at Socket.emit (events.js:412:35)
at endReadableNT (internal/streams/readable.js:1333:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mobile_banking#0.0.0 dev: `vite`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mobile_banking#0.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
please what can i do.
I've tried deleting the package.json and package-lock.json and installing it back using npm install but it still won't work.

react error-error: This is probably not a problem with npm. There is likely additional logging output above

In my project, I'm using react. Now what I'm trying to do is deploy my project which is in remote server into the actual server. I'm using npm to create and start a project. But I can't build my project since the following error occurs again and again,
C:\Users\User\react-tutorial>npm start
> react-tutorial#0.1.0 start C:\Users\User\react-tutorial
> react-scripts start
i 「wds」: Project is running at http://192.168.225.236/
i 「wds」: webpack output is served from
i 「wds」: Content not from webpack is served from C:\Users\User\react-tutorial\public
i 「wds」: 404s will fallback to /
Starting the development server...
events.js:292
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: [ '/s', '/c', 'start', '""', '/b', '"http://localhost:3000/"' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-tutorial#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-tutorial#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\User\AppData\Roaming\npm-cache\_logs\2020-07-27T07_26_30_467Z-debug.log
How can I resolve this problem?
edit:it worked i got the answer
Already asked here
Try to add C:\Windows\System32 to the global PATH environment variable or clear npm cache with
npm cache clear --force

I am trying to download React js, but I am getting this error again and again?

I am downloading react js with npm , but I am getting this error again and again. Can any give me solution.I have tried multiple times but it is still giving me same error.
C:\react\todo>npm start
> todo#0.1.0 start C:\react\todo
> react-scripts start
Starting the development server...
events.js:180
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:77:11) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/c', 'start', '""', '/b', 'http://localhost:3000/' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! todo#0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the todo#0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HAROON & ABDULREHMAN\AppData\Roaming\npm-cache\_logs\2019-08-28T21_27_54_711Z-debug.log
After some research, I found this.
I(tylerlaberge) ran into this exact issue as well and found that it is only present with react-scripts#3.0.0, downgrading to react-scripts#2.1.8 resolved the issue without needing to mess with environment variables.
create-react-app my-app
cd my-app
npm install react-scripts#2.1.8
npm start
https://github.com/facebook/create-react-app/issues/6985#issuecomment-490319841
You should use npx create-react-app appname this is from react docs https://reactjs.org/docs/create-a-new-react-app.html. I use to have a lot of problems when I used npm create-react-app, they all went away when I stated using npx.

Error: spawn cmd ENOENT at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)

C:\repo\dem1>npm start
# start C:\repo\dem1
expo start
Starting project at C:\repo\dem1
Expo DevTools is running at http://localhost:19002
Opening DevTools in the browser... (press shift-d to disable)
Error: spawn cmd 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)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! # start: expo start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the # start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
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.

npm install fails with message "Error: socket hang up"

I met this problem when execute the npm install module-name --save
It fails no matter what I install.
And it fails if I specified it in the package.json . and then run the npm install for the whole project.
There are some similar question posted like
NPM doesn't install any modules: network socket hangs up
NodeJS - What does "socket hang up" actually mean?
but unfortunately, it doesn't work for me. Also, npm install is OK with my other projects.
My environment: npm v6.4.1, node.js v10.10.0 serverless v1.28.0
Appreciated for the help of any kinds.
Here is my log message in my console:
> spawn-sync#1.0.15 postinstall /Users/pro/node_modules/spawn-sync
> node postinstall
> serverless#1.28.0 postinstall /Users/pro/node_modules/serverless
> node ./scripts/postinstall.js
Error: socket hang up
at createHangUpError (_http_client.js:322:15)
at TLSSocket.socketOnEnd (_http_client.js:425:23)
at TLSSocket.emit (events.js:187:15)
at TLSSocket.EventEmitter.emit (domain.js:442:20)
at endReadableNT (_stream_readable.js:1092:12)
at process._tickCallback (internal/process/next_tick.js:63:19)
npm WARN cognito-backend#1.0.0 No description
npm WARN cognito-backend#1.0.0 No repository field.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! serverless#1.28.0 postinstall: `node ./scripts/postinstall.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the serverless#1.28.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
I found a github issue that solves my problem:
https://github.com/maciejtreder/ng-toolkit/issues/448
use nvm install v10.6.0

Categories