ERR_FAILED (-2) error when running npx cypress open - testing

I have a barebone create-react-app with nothing but cypress installed through npm i cypress
When I run npx cypress open I get this error:
ERR_FAILED (-2) loading 'http://localhost:49770/__launchpad/index.html'
Error: ERR_FAILED (-2) loading 'http://localhost:49770/__launchpad/index.html'
at rejectAndCleanup (node:electron/js2c/browser_init:165:7500)
at EventEmitter.stopLoadingListener (node:electron/js2c/browser_init:165:7875)
at EventEmitter.emit (node:events:527:28)
at EventEmitter.emit (node:domain:475:12)
What could be the reason for this? I have tried to stop the firewall and restart my PC but it didn't work.

https://lightrun.com/answers/cypress-io-cypress-1030-regression---test-runner-randomly-fails-when-running-electron-locally
I found a solution that worked for me. I was running the command in a cmd with admin privileges. According to this article, you need to run it in a cmd without admin rights.

Related

Getting error when installing Bugsnag 'Error: spawn npm ENOENT'

this is the first time I post here so apologies if I don't follow some rules or incorrect formatting.
I'm making an app using React Native and Expo and when I try to install bugsnag I get this error.
$ npx bugsnag-expo-cli init
โˆš #bugsnag/expo does not appear to be installed, do you want to install it? ... yes
โˆš If you want the latest version of #bugsnag/expo hit enter, otherwise type the version you want ... latest
โˆš Using yarn or npm? ยป npm
> Installing #bugsnag/expo with npm. This could take a while!
Error: spawn npm ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
at onErrorNT (internal/child_process.js:465:16)
at processTicksAndRejections (internal/process/task_queues.js:80:21)
Are you attempting to run the bugsnag-expo-cli on Windows? The Expo CLI currently only supports MacOS and Linux:
https://docs.bugsnag.com/platforms/react-native/expo/#installation-and-configuration
As an alternative to the CLI, you can follow the manual integration guide:
https://docs.bugsnag.com/platforms/react-native/expo/manual-setup/

Error with React Native when trying to start App

I'm following the steps provided in the Documentation to set up the environment for React Native.
I have installed create-react-native-app as well as expo-cli .
Further I have created an app using expo init.
Now when I'm trying to run the app with yarn start or npm start I get the following error:
Error: spawn powershell 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)
error Command failed with exit code 1.
How do i solve it? is that something related to powershell? (But i get it in Command Prompt too)
P.S. I'm using Windows 8, Expo 3.24.2, yarn 1.22.4, node 10.15.3
I also faced the same error while running yarn start.
To fix this: go to
Control Panel -> System and Security -> System -> Advanced System Settings ->
Environment Variables.
Under User variables -> Variable PATH -> add a new path i.e,
(C:\Windows\System32\WindowsPowerShell\v1.0)
Then click Ok and close the Control Panel.
Now open Windows Powersell and write:
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
Click enter and close the powershell
reopen the cmd and type yarn start or npm start
Error is gone :)

Appium - Android - Error: spawn appium ENOENT

I am trying to run android tests with the command node ./node_modules/.bin/wdio config/wdio.android.browser.conf.js and getting the following error:
me$ node ./node_modules/.bin/wdio config/wdio.android.browser.conf.js
events.js:183
throw er; // Unhandled 'error' event
^
Error: spawn appium ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
at onErrorNT (internal/child_process.js:362:16)
at _combinedTickCallback (internal/process/next_tick.js:139:11)
at process._tickDomainCallback (internal/process/next_tick.js:219:9)
at Function.Module.runMain (module.js:696:11)
at startup (bootstrap_node.js:204:16)
at bootstrap_node.js:625:3
I have the following versions in my package.json:
"wdio-appium-service": "^0.2.3",
"appium": "^1.12.1",
Please let me know what other info I can provide. Thank you.
I think I figured it out... in config/wdio.android.browser.conf.js I had services: [ 'appium' ], and trying to run just appium on my machine wasn't working. I installed appium globally with npm install -g appium and that made it work. I think I can point services to the appium in the local node_modules directory and maybe it would run it from there.
If you are using windows OS, appium section in your config file shall include command: 'appium.cmd' like this :
{
services: ['appium'],
appium: {
command: 'appium.cmd',
...
}
}
This error occurs due to 2 possible issues:
1) JAVAHOME variable is not correctly set for appium to start & run tests.
-> Check that JAVAHOME is correctly set and path points to the correct file.
2) There could have been some errors during Appium installation.
-> Try reinstalling appium using npm install -g appium command and ensure that appium is installed without any errors.
Obviously, run npm install to check and install any missing dependencies too.

Running `expo start` fails with ENOENT error just after installing expo-cli on windows 10

I'm on Windows 10 Version 10.0.16299 Build 16299. I'm using Powershell. I just used yarn global add expo-cli to install expo, then I ran expo init my-app then cd my-app and expo start, but the build is failing. Here's the error image and text:
[23:11:49] Starting project at C:\projects\my-app
[23:11:58] Starting Metro Bundler on port 19001.
[23:11:58] Metro Bundler ready.
[23:12:00] Expo DevTools is running at http://localhost:19002
[23:12:00] Opening DevTools in the browser... (press shift-d to disable)
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:229:19)
at onErrorNT (internal/child_process.js:406:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
Any ideas? Or even suggestions on another place where I can post this issue since it's failing out of the box. All help appreciated.
For windows:-
add environment variable in
set Path - C:\Windows\System32\
after setting path. restart your computer.
In my case, I added C:\Windows\System32\
See the Picture below:

React Native, Error while Launching Dev Tools. in ubuntu 16

I have installed a new react native project using create-react-native-app. When I do yarn start or npm start and scan with expo, it gives me the following error in ubuntu (when remote js debugging is on).
Launching Dev Tools...
Google Chrome exited with error: Error: Exited with code 1
at ChildProcess. (/home/shivam/AwesomeProject/node_modules/opn/index.js:86:8)
at Object.onceWrapper (events.js:254:19)
at ChildProcess.emit (events.js:159:13)
at maybeClose (internal/child_process.js:943:16)
at Socket.stream.socket.on (internal/child_process.js:363:11)
at Socket.emit (events.js:159:13)
at Pipe._handle.close [as _onclose] (net.js:568:12)
Finished building JavaScript bundle in 95196ms
Stopping packager...
Packager stopped.
Done in 701.25s.
But its not the case with windows(it opens the debugger in browser).I guess in ubuntu It tries to launch debugger in browser, but somehow fails to do so. I followed some links but none of them helped.
https://github.com/facebook/react-native/issues/9901
https://github.com/facebook/react-native/issues/990
https://github.com/facebook/react-native/issues/297
Run yarn or npm without sudo, because when you enable devtools it's tries opening chrome by command (chrome won't open with sudo)
You can do it open google chrome and hit this url http://localhost:8081/debugger-ui
open console tab to debug
Disable Chrome cache
Right-click chrome
Go to 'inspect element'
Look for the 'network' tab somewhere at the top. Click it.
Check the 'disable cache' checkbox.
Reference : react-native-debugging