reavt native event.js 167 error //unknown error - react-native

BUILD SUCCESSFUL in 14s
28 actionable tasks: 1 executed, 27 up-to-date
Running adb -s 988ad833354d59594330 reverse tcp:8081 tcp:8081
Starting the app on 988ad833354d59594330 (adb -s 988ad833354d59594330 shell am start -n com.celebrations/com.celebrations.MainActivity)...
Starting: Intent { cmp=com.celebrations/.MainActivity }
events.js:167
throw er; // Unhandled 'error' event
^
Error: spawn cmd.exe 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)
i was building the code for the first time and getting this error while compiling.
any solutions for this error??

It means you already use port 8081, but you can run these commands:
sudo lsof -i :8081
kill -9 < PID >

Related

node:events:505 throw er; // Unhandled 'error' event while running graph-cli

I have been trying to run the graph npm package. However, whenever I run the command I get the following error. I use WSL2 if that is relevant.
`
node:events:505
throw er; // Unhandled 'error' event
^
Error: failed to connect to [localhost:27017]
at exports.ConnectionPool. (/usr/local/lib/node_modules/graph-cli/node_modules/mongodb/lib/mongodb/connection/server.js:556:25)
at exports.ConnectionPool.emit (node:events:527:28)
at exports.ConnectionPool.emit (node:domain:475:12)
at exports.Connection. (/usr/local/lib/node_modules/graph-cli/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:156:15)
at exports.Connection.emit (node:events:527:28)
at exports.Connection.emit (node:domain:475:12)
at Socket. (/usr/local/lib/node_modules/graph-cli/node_modules/mongodb/lib/mongodb/connection/connection.js:534:10)
at Socket.emit (node:events:527:28)
at Socket.emit (node:domain:475:12)
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)
Emitted 'error' event on NativeConnection instance at:
at NativeConnection.Connection.error (/usr/local/lib/node_modules/graph-cli/node_modules/mongoose/lib/connection.js:389:8)
at /usr/local/lib/node_modules/graph-cli/node_modules/mongoose/lib/connection.js:416:14
at /usr/local/lib/node_modules/graph-cli/node_modules/mongoose/lib/drivers/node-mongodb-native/connection.js:57:21
at /usr/local/lib/node_modules/graph-cli/node_modules/mongodb/lib/mongodb/db.js:286:18
at /usr/local/lib/node_modules/graph-cli/node_modules/mongodb/lib/mongodb/db.js:365:7
at processTicksAndRejections (node:internal/process/task_queues:78:11)
`
It's not clear to me why this is happening and I have been struggling to debug this for the last 2 days. Please help!
I have tried running mongodb which then starts up a server on that port, but then the graph command just stay stuck
I have tried upgrading the mongoose version
I have tried reinstalling graph-cli

create-react-app circle build failed

!/bin/bash -eo pipefail
yarn build
yarn run v1.6.0
$ react-scripts build
Creating an optimized production build...
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
events.js:183
throw er; // Unhandled 'error' event
^
Error: This socket has been ended by the other party
at Socket.writeAfterFIN [as write] (net.js:364:12)
at PoolWorker.writeJson (/home/circleci/repo/node_modules/thread-loader/dist/WorkerPool.js:89:22)
at PoolWorker.run (/home/circleci/repo/node_modules/thread-loader/dist/WorkerPool.js:69:12)
at WorkerPool.distributeJob (/home/circleci/repo/node_modules/thread-loader/dist/WorkerPool.js:326:20)
at /home/circleci/repo/node_modules/thread-loader/node_modules/async/queue.js:10:5
at Object.process (/home/circleci/repo/node_modules/thread-loader/node_modules/async/internal/queue.js:175:17)
at /home/circleci/repo/node_modules/thread-loader/node_modules/async/internal/queue.js:115:15
at /home/circleci/repo/node_modules/thread-loader/node_modules/async/internal/onlyOnce.js:12:16
at callback (/home/circleci/repo/node_modules/thread-loader/dist/WorkerPool.js:163:21)
at /home/circleci/repo/node_modules/thread-loader/dist/WorkerPool.js:190:15
at /home/circleci/repo/node_modules/thread-loader/node_modules/async/internal/map.js:32:9
at /home/circleci/repo/node_modules/thread-loader/node_modules/async/internal/once.js:12:16
at replenish (/home/circleci/repo/node_modules/thread-loader/node_modules/async/internal/eachOfLimit.js:61:25)
at iterateeCallback (/home/circleci/repo/node_modules/thread-loader/node_modules/async/internal/eachOfLimit.js:50:17)
at /home/circleci/repo/node_modules/thread-loader/node_modules/async/internal/onlyOnce.js:12:16
at /home/circleci/repo/node_modules/thread-loader/node_modules/async/internal/map.js:29:13
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Exited with code 1

SessionNotCreatedException: A new session could not be created.INSTALL_FAILED_ALREADY_EXISTS:

info: [debug] Setting device id to ZY223DDMM8
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 wait-for-device
info: [debug] executing cmd: E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Pushing unlock helper app to device...
info: [debug] executing cmd: E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Command failed: C:\Windows\system32\cmd.exe /s /c "E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk""
Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]
info: [debug] Error: Command failed: C:\Windows\system32\cmd.exe /s /c "E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk""
Failed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]
at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1016:16)
at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: C:\Windows\system32\cmd.exe /s /c \"E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install \"C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk\"\"\nFailed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]\r\n)","killed":false,"code":1,"signal":null,"cmd":"C:\Windows\system32\cmd.exe /s /c \"E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install \"C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk\"\"","origValue":"Command failed: C:\Windows\system32\cmd.exe /s /c \"E:\MobileAutomation\Android\android-sdk\platform-tools\adb.exe -s ZY223DDMM8 install \"C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk\"\"\nFailed to install C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk: Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.unlock without first uninstalling.]\r\n"},"sessionId":null}
info: <-- POST /wd/hub/session 500 3251.479 ms - 1342
add --no-reset flag so that appium doesnt try to install the apk again or uninstall the apk before you run the test scripts

xcodebuild failed with code 65

When i try to launch App with Appium getting below error
[debug] [XCUITest] Error : Command 'bash -c "ps -ax|grep -i \"xcodebuild\"|grep -i \"faea4372d3a65bdb23969752f0d5902ca21c5571\"|grep -v grep|awk '{print \"kill -9 \" \$1}'|sh"' errored out: Error: spawn bash ENOENT
I've tried by adding Code_signing and team id with xcodeconfig capability but it is not working, could you please help me on this
Below are the capabilities set to
app: '/Users/arun/Documents/App/iOSAutomationTests/src/main/resources/test.ipa'
rotatable: true
newCommandTimeout: 120
realDeviceLogger: '/usr/local/lib/node_modules/deviceconsole'
platformVersion: '10.1.1'
automationName: 'XCUITest'
xcodeConfigFile: '/src/main/resources/myconfig.xcconfig'
platformName: 'iOS'
udid: 'faea4372d3a65bdb23969752f0d5902ca21c5571'
deviceName: 'faea4372d3a65bdb23969752f0d5902ca21c5571'
autoAcceptAlerts: true
Below is the log
XCUITest] Launching WebDriverAgent on the device
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage
[debug] [XCUITest] Killing hanging processes
[debug] [XCUITest] Error : Command 'bash -c "ps -ax|grep -i \"xcodebuild\"|grep -i \"faea4372d3a65bdbd7969752f0d5948ca21c5571\"|grep -v grep|awk '{print \"kill -9 \" \$1}'|sh"' errored out: Error: spawn bash ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
[debug] [XCUITest] Error : Command 'bash -c "ps -ax|grep -i \"/usr/local/lib/node_modules/deviceconsole\"|grep -i \"faea4372d3a65bdbd7969752f0d5948ca21c5571\"|grep -v grep|awk '{print \"kill -9 \" \$1}'|sh"' errored out: Error: spawn bash ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
[debug] [XCUITest] Error : Command 'bash -c "ps -ax|grep -i \"iproxy\"|grep -i \"faea4372d3a65bdbd7969752f0d5948ca21c5571\"|grep -v grep|awk '{print \"kill -9 \" \$1}'|sh"' errored out: Error: spawn bash ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:193:32)
at onErrorNT (internal/child_process.js:359:16)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)
[XCUITest] Real device logger '/usr/local/lib/node_modules/deviceconsole' is a directory. Appending 'deviceconsole' executable
[debug] [XCUITest] Using real device logger '/usr/local/lib/node_modules/deviceconsole/deviceconsole'
[debug] [XCUITest] Using Xcode configuration file: '/src/main/resources/myconfig.xcconfig'
[debug] [XCUITest] Beginning test with command 'xcodebuild build test -project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination id=faea4372d3a65bdbd7969752f0d5948ca21c5571 -configuration Debug -xcconfig /src/main/resources/myconfig.xcconfig' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Waiting for WebDriverAgent to start on device
[debug] [XCUITest] Log file for xcodebuild test: /Users/arun.sambu/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/F08249A4-D6EB-4D3A-9354-0E638607CC28/Session-WebDriverAgentRunner-2017-02-03_142740-DZsDR7.log
[Xcode] 2017-02-03 14:27:41.093 xcodebuild[4292:81409] Error Domain=IDETestOperationsObserverErrorDomain Code=3 "Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/arun.sambu/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/F08249A4-D6EB-4D3A-9354-0E638607CC28/Session-WebDriverAgentRunner-2017-02-03_142740-DZsDR7.log" UserInfo={NSLocalizedDescription=Test operation was canceled. If you believe this error represents a bug, please attach the log file at /Users/arun.sambu/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/F08249A4-D6EB-4D3A-9354-0E638607CC28/Session-WebDriverAgentRunner-2017-02-03_142740-DZsDR7.log}
[Xcode]
Testing failed:
./Scripts/generate_modules.sh: line 15: Modules/module.modulemap: No such file or directory
** TEST FAILED **
The following build commands failed:
PhaseScriptExecution Generate\ modules /Users/arun.sambu/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Intermediates/WebDriverAgent.build/Debug-iphoneos/WebDriverAgentLib.build/Script-AD35D0281CF1B37A00870A75.sh
[Xcode] (1 failure)
Make sure your current user has write permissions to the folder where Appium is currently installed.
You can find some help here to change permission: https://apple.stackexchange.com/questions/16180/xcode-problem-with-directory-permissions
This issue is solved with Appium 1.6.3.
if you still face any issues, you can find the solution here:
https://github.com/appium/appium-xcuitest-driver/blob/master/docs/real-device-config.md
Code 65 is the issue with code_signing,
If xcode config is not working for you, try manually signing WebDriverAgent in Xcode, that should do the trick, however I would suggest upgrading to 1.6.4, in which this issue has been resolved:
Allow for the auto-generation of the Xcode config file used to configurable
WDA before launch. This includes two new desired capabilities
xcodeOrgId - the Apple developer team identifier string
xcodeSigningId - a string representing a signing certificate, defaulting to
"iPhone Developer"
Below is the link:
https://github.com/appium/appium/releases

Mongoose error when running node

When I run node server.js in terminal, I receive the following error from mongoose:
/Users/XXXX/Desktop/Projects/crud/node_modules/mongoose/node_modules/mongodb/lib/server.js:235
process.nextTick(function() { throw err; })
^
Error: connect ECONNREFUSED 127.0.0.1:27017
at Object.exports._errnoException (util.js:860:11)
at exports._exceptionWithHostPort (util.js:883:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1063:14)
I've ran npm install mongoose with a warning, but I doubt that's the reason the mongodb database isn't running. Here is the warning:
> kerberos#0.0.17 install /Users/Sean/Desktop/Projects/crud/node_modules/kerberos
> (node-gyp rebuild) || (exit 0)
CXX(target) Release/obj.target/kerberos/lib/kerberos.o
CXX(target) Release/obj.target/kerberos/lib/worker.o
CC(target) Release/obj.target/kerberos/lib/kerberosgss.o
../lib/kerberosgss.c:509:13: warning: implicit declaration of function 'gss_acquire_cred_impersonate_name' is invalid in C99
[-Wimplicit-function-declaration]
maj_stat = gss_acquire_cred_impersonate_name(&min_stat,
^
1 warning generated.
CC(target) Release/obj.target/kerberos/lib/base64.o
CXX(target) Release/obj.target/kerberos/lib/kerberos_context.o
SOLINK_MODULE(target) Release/kerberos.node
It can happen when the mongodb service is not running on your machine.So start with below command it will be help you to open node server with no interrupt as well as mongodb will also run on default port.
brew services start mongodb