Running gulp to build my project.
Throws error:
[14:35:01] Starting 'images'...
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn X\node_modules\optipng-bin\vendor\optipng.exe ENOENT
at _errnoException (util.js:1024: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._tickCallback (internal/process/next_tick.js:180:9)
Currently installed OptiPNG version 0.7.6
Not sure what to check or do next?
Resolution was to delete node_modules folder and run npm install again.
Related
When i try to start my react application with npm start, i get the following error:
events.js:377
throw er; // Unhandled 'error' event
^
Error: spawn powershell ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:274:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Starting the development server...
events.js:377
throw er; // Unhandled 'error' event
^
Error: spawn powershell ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:274:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:280:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn powershell',
path: 'powershell',
spawnargs: [
'-NoProfile',
'-NonInteractive',
'–ExecutionPolicy',
'Bypass',
'-EncodedCommand',
'UwB0AGEAcgB0ACAAIgBgACIAaAB0AHQAcAA6AC8ALwBsAG8AYwBhAGwAaABvAHMAdAA6ADgAMAA4ADYALwBwAG8AcgB0AGEAbABgACIAIgA='
]
}
The command was executed in Visual Studio Code.
Executing the command in a command shell produces nearly the same error:
> fe-core4#0.1.0 start
> set PORT=8086 && set HTTPS=false && react-scripts start
i 「wds」: Project is running at http://172.19.42.69/
i 「wds」: webpack output is served from /portal
i 「wds」: Content not from webpack is served from C:\Users\...
i 「wds」: 404s will fallback to /portal/
Starting the development server...
events.js:377
throw er; // Unhandled 'error' event
^
Error: spawn powershell ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:274:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:280:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn powershell',
path: 'powershell',
spawnargs: [
'-NoProfile',
'-NonInteractive',
'–ExecutionPolicy',
'Bypass',
'-EncodedCommand',
'UwB0AGEAcgB0ACAAIgBgACIAaAB0AHQAcAA6AC8ALwBsAG8AYwBhAGwAaABvAHMAdAA6ADgAMAA4ADYALwBwAG8AcgB0AGEAbABgACIAIgA='
]
}
Lately i had trouble with installing maven and accidently removed the PATH system environment variable. I kind of restored it somehow but maybe some things still don't work properly, which could be the reason for the error.
My PATH system environment variable:
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\bin
%MAVEN_HOME%\bin
C:\Windows
C:\Windows\System32\Wbem
C:\Program Files\nodejs\
C:\Program Files\Git\bin\
C:\Program Files\Git\cmd\
C:\Windows\System32
Update
npm start runs the following code:
set PORT=8086 && set HTTPS=false && react-scripts start
NPM and node.js seem to work fine:
> node -v
v16.13.2
> npm -v
8.4.0
I found a solution to my problem.
At first i copied the values of the PATH system environment variable from a friend:
%USERPROFILE%\AppData\Local\Microsoft\WindowsApps
%USERPROFILE%\AppData\Local\Programs\Microsoft VS Code\bin
%MAVEN_HOME%\bin
C:\Program Files\Git\bin\
C:\Program Files\Git\cmd\
%SystemRoot%\system32
%SystemRoot%
%SystemRoot%\System32\Wbem
%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\
%SYSTEMROOT%\System32\OpenSSH
C:\Program Files\nodejs\
After that i got the following error for every npm command i tried to execute
npm ERR! Unexpected token '.'
So i followed this guide to completely remove node and then reinstalled the node lts version 14.19.0. After that everything worked fine again.
I have a newly created react-app and on my first npm start it throws an unhandled error.
Starting the development server...
node:events:342
throw er; // Unhandled 'error' event
^
Error: spawn /usr/bin/firefox 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 /usr/bin/firefox',
path: '/usr/bin/firefox',
spawnargs: [ 'http://localhost:3000' ]
I don't have any dependencies as of now but i don't get what is causing this error. But the dev server starts with
sudo npm start
I think its because of a permission error , please uninstall existing nodejs, npm and try to install nodejs using nvm it will help you to overcome permission issues in npm
I am using Manjaro and have downloaded google-chrome-stable from the AUR package. Even though google chrome is set as a default browser, npm start still defaults to opening firefox, after I deleted firefox I start receiving the following error
Starting the development server...
node:events:342
throw er; // Unhandled 'error' event
^
Error: spawn /usr/bin/firefox 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 /usr/bin/firefox',
path: '/usr/bin/firefox',
spawnargs: [ 'http://localhost:3000' ]
}
React uses the BROWSER environment variable to decide what browser to use. Try running your React app as follows:
BROWSER=/usr/bin/google-chrome-stable npm start
If this works fine, you can set Chrome to be the default in these cases by adding
export BROWSER=/usr/bin/google-chrome-stable
to your terminal profile (~/.zshrc, if you're using zsh).
I am getting this error while trying to use
create-react-app folder-name
Same type of error occurs when when I use following code
npx create-react-app folder-name
cd folder-name
npm start
Error
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
events.js:292
throw er; // Unhandled 'error' event
^
Error: spawn cmd.exe 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 ChildProcess.cp.emit (C:\Users\Manoj Mukthavaram\AppData\Roaming\npm\node_modules\create-react-app\node_modules\cross-spawn\lib\enoent.js:34:29)
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.exe',
path: 'cmd.exe',
spawnargs: [
'/d',
'/s',
'/c',
'"npm ^"install^" ^"--save^" ^"--save-exact^" ^"--loglevel^" ^"error^" ^"react^" ^"react-dom^" ^"react-scripts#0.9.x^""'
]
}
use npx create-react-app . // (dot)
once you create project folder and see that your are in your current folder
I unable to start the selenium server by using protractor in cmd as webdriver-manager start
I have update webdriver-manager update -g and shows are upto date
But problem is as given below I have also updated java path too
C:\Users\java>webdriver-manager start
seleniumProcess.pid: 0
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:1001:11)
at Process.ChildProcess._handle.onexit (child_process.js:792:34)