I am currently trying to run a project (simple test project) of next.js on a Linux server. The project is able to run locally no problem, however every time I run npm run dev or npm run build I get the following error:
node:events:368
throw er; // Unhandled 'error' event
^
Error: spawn /nfs/encs/ArchDep/x86_64.EL7/pkg/node-v16.13.0/root/bin/node EAGAIN
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: -11,
code: 'EAGAIN',
syscall: 'spawn /nfs/encs/ArchDep/x86_64.EL7/pkg/node-v16.13.0/root/bin/node',
path: '/nfs/encs/ArchDep/x86_64.EL7/pkg/node-v16.13.0/root/bin/node',
spawnargs: [
'/nfs/www/groups/h/hn_comp353_2/comp353/node_modules/jest-worker/build/workers/processChild.js'
]
}
Any idea on how to resolve this issue?
I see in your spawnargs that it's trying to execute jest, so this failure has something to do with your Jest tests not being able to run on your Linux server. This may be caused by Jest trying to spawn more threads than there are resources available on your server. This is pretty common on heavily virtualized environments where the resources are limited.
Can you try running Jest with either the --runInBand or --maxWorkers=2? If you're running Jest through npm you'll have to add the command in your package.json like this:
{
"scripts": {
"test": "jest --runInBand"
}
}
As a general remark, NodeJS Error: spawn errors are tricky to debug and can be caused by a variety of issues. There's another SO Q&A with a lot of resources on this topic you can consult.
Related
I am trying to create a atlassian connect app for Jira, and this is my first attempt at this. I have configured all the dependencies, including Python 2.7 and windows-production-tools required for it. I have generated an app and trying to run it using npm start, when I am facing the following issue:
Watching atlassian-connect.json for changes
App server running at http://IN-8BRM2J3:3000
node:events:505
throw er; // Unhandled 'error' event
^
Error: spawn ./ngrok.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)
at process.runNextTicks [as _tickCallback] (node:internal/process/task_queues:65:3)
at node:internal/main/run_main_module:17:47
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12)
I have already npm install ngrok and successfully configured the auth token using ngrok authtoken my-token.
Seems like node is not able to access the ngrok application. Can someone suggest me how to resolve this issue ?
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
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
i have alawys use npm start to run a React application
these days i try to use this command i got an error
and it goes like this
ps: i'm using ubuntu 20.04
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:480: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:480:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn brave',
path: 'brave',
spawnargs: [ 'http://localhost:3000' ]
}
I have deleted the cache,
I did delete node_modules and run npm install
and still i face the same problem
and if i use sudo npm start everything works fine
I think you installed node with root permission, that we lead to restricting non-sudo to use global packages.
I suggest that you remove the current node installation, and use nvm instead to install the desired node version https://github.com/nvm-sh/nvm.
after that, you need to install react-create-app again.
I installed nodejs and after then when I try to run my previous react app by running yarn start it gives me an error something like this.
Even if I make a new app with create-react-app it gives the same error while trying to start.
nodejs apps are working fine so I think the problem is with create-react-app. I don't know how to fix them.
$ react-scripts start
Starting the development server...
events.js:174
throw er; // Unhandled 'error' event
^
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)
Emitted 'error' event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
And I have no idea what is wrong. Please help me fix this.
Change react-scripts version in package.json to 2.1.8. It works for me.