Why is TestCafe crashing on launch testing Electron app with simple command-line? - testing

I am attempting to run a test on our Electron app using TestCafe. I am getting an error mentioning a "-m" command, however that is not used in my script or command line.
I have everything set up as described here:
https://github.com/DevExpress/testcafe-browser-provider-electron#testing-an-executable-electron-application
C:\packages>testcafe -d "electron:C:\Program Files\OurApp\"
"C:\Temp\test.js" -hostname localhost
Using locally installed version
of TestCafe. ERROR Tested app failed with an error:
Error: Command failed: -m '-m' is not recognized as an internal or
external command, operable program or batch file.
at ChildProcess.exithandler (child_process.js:275:12)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Socket.stream.socket.on (internal/child_process.js:346:11)
at emitOne (events.js:116:13)
at Socket.emit (events.js:211:7)
at Pipe._handle.close [as _onclose] (net.js:557:12)
Type "testcafe -h" for help.
The script for test.js is below:
import { Selector } from 'testcafe';
fixture `Electron test`
.page('./index.html');
test('smoke 1', async t => {
await t
.debug()
.click(Selector().withText('Create a new configuration'));
});
What could be the cause?

The cause is in an incorrect -hostname argument. It should be --hostname. I'm not sure why some -m error appears but tests work after I fix incorrect argument syntax.

Related

Error on any command npm. Error on any command npm

TypeError: invalid options argument at optsArg (/node_modules/mkdirp/lib/opts-arg.js:13:11) at mkdirp (/node_modules/mkdirp/index.js:11:10) at inferOwner.then.owner (/usr/share/npm/node_modules/gentle-fs/lib/mkdir.js:14:5) Error: npm.load() required at Object.get (/usr/share/npm/lib/npm.js:59:13) at process.errorHandler (/usr/share/npm/lib/utils/error-handler.js:205:32) at process.emit (events.js:198:13) at emitPromiseRejectionWarnings (internal/process/promises.js:140:18) at process._tickCallback (internal/process/next_tick.js:69:34) /usr/share/npm/lib/npm.js:59 throw new Error(npm.load() required) ^ Error: npm.load() required at Object.get (/usr/share/npm/lib/npm.js:59:13) at process.errorHandler (/usr/share/npm/lib/utils/error-handler.js:205:32) at process.emit (events.js:198:13) at process._fatalException (internal/bootstrap/node.js:497:27)
What's going on here? I do not understand anything
clean ubuntu focal.
Deleted /node_modules and installed npm via nvm. Now it works.

Build (React native) Android app and generate .apk file by using turtle cli from azure devops pipeline

I am trying to build Android app by using turtle cli for this i am using below script.
![258988-image.png][1]
npm install -g turtle-cli
turtle cli has installed and build also started but failing at building section, i am getting below error.
I am stuck guys, Could you please guide me where i am doing mistake. Let me know if you need more information.
error:
Nov 9 13:06:46 turtle[19222] ERROR: Failed to build standalone app
err: Error: ./gradlew exited with non-zero code: 1
at ChildProcess.completionListener (/Users/runner/hostedtoolcache/node/14.19.3/x64/lib/node_modules/turtle-cli/node_modules/#expo/xdl/node_modules/#expo/spawn-async/src/spawnAsync.ts:65:13)
at Object.onceWrapper (events.js:520:26)
at ChildProcess.emit (events.js:400:28)
at ChildProcess.emit (domain.js:475:12)
at maybeClose (internal/child_process.js:1088:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
...
at spawnAsync (/Users/runner/hostedtoolcache/node/14.19.3/x64/lib/node_modules/turtle-
cli/node_modules/#expo/xdl/node_modules/#expo/spawn-async/src/spawnAsync.ts:26:19)
at spawn Async Throw Error (/#expo/xdl#59.2.1/src/detach/ExponentTools.ts:111:19)
at build Shell App sync (/#expo/xdl#59.2.1/src/detach/AndroidShellApp.js:1494:11)
at Object.create Android Shell AppAsync (/#expo/xdl#59.2.1/src/detach/AndroidShellApp.js:382:5)
at runShellAppBuilder (/Users/runner/hostedtoolcache/node/14.19.3/x64/lib/node_modules/turtle-cli/src/builders/android.ts:99:5)
at buildAndroid (/Users/runner/hostedtoolcache/node/14.19.3/x64/lib/node_modules/turtle-cli/src/builders/android.ts:31:26)
at /Users/runner/hosted tool cache/node/14.19.3/x64/lib/node_modules/turtle-cli/src/bin/utils/builder.ts:87:7
at Command. (/Users/runner/hosted tool cache/node/14.19.3/x64/lib/node_modules/turtle-cli/src/bin/index.ts:23:12)
platform: "android"

React Native Expo set up on macOS

After downloading watchman through brew and an expo blank template for my project I have attempted to run a yarn start within the terminal however, I get back the following error:
2022-06-21T09:09:00,229: [] while computing sockname: failed to create /opt/local/var/run/watchman/theflood-state: No such file or directory
Watchman: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2022-06-21T09:09:00,229: [] while computing sockname: failed to create /opt/local/var/run/watchman/theflood-state: No such file or directory
/Applications/Telsa-project/TelsaClone/node_modules/metro-hermes-compiler/src/emhermesc.js:77
throw ex;
^
Error: watchman --no-pretty get-sockname returned with exit code=1, signal=null, stderr= 2022-06-21T09:09:00,229: [] while computing sockname: failed to create /opt/local/var/run/watchman/theflood-state: No such file or directory
at ChildProcess.<anonymous> (/Applications/Telsa-project/TelsaClone/node_modules/fb-watchman/index.js:198:18)
at ChildProcess.emit (node:events:527:28)
at maybeClose (node:internal/child_process:1092:16)
at Socket.<anonymous> (node:internal/child_process:451:11)
at Socket.emit (node:events:527:28)
at Pipe.<anonymous> (node:net:709:12)
Emitted 'error' event on Client instance at:
at spawnError (/Applications/Telsa-project/TelsaClone/node_modules/fb-watchman/index.js:170:10)
at ChildProcess. (/Applications/Telsa-project/TelsaClone/node_modules/fb-watchman/index.js:198:7)
at ChildProcess.emit (node:events:527:28)
[... lines matching original stack trace ...]
at Pipe. (node:net:709:12)
error Command failed with exit code 7.
I've tried to reinstall watchman but that doesn't seem to make a difference.
Does anyone know how I might go about fixing this error?

Nuxt App Output Error when trying to Create

I want to initialize a Nuxt Project using the command
yarn create nuxt-app <project-name>
i get this error:
C:\Users\AbdulAzeez\AppData\Local\Yarn\Data\global\node_modules\sao\lib\installPackages.js:108
throw new SAOError(`Failed to install ${packageName} in ${cwd}`)
^
SAOError: Failed to install packages in C:\Users\AbdulAzeez\Desktop\vue-sax-demo
at ChildProcess.<anonymous> (C:\Users\AbdulAzeez\AppData\Local\Yarn\Data\global\node_modules\sao\lib\installPackages.js:108:15)
at ChildProcess.emit (events.js:315:20)
at ChildProcess.cp.emit (C:\Users\AbdulAzeez\AppData\Local\Yarn\Data\global\node_modules\sao\node_modules\cross-spawn\lib\enoent.js:34:29)
at maybeClose (internal/child_process.js:1051:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
__sao: true
}
error Command failed.
Exit code: 1
Command: C:\Users\AbdulAzeez\AppData\Roaming\npm\bin\create-nuxt-app
Arguments: vue-sax-demo
Directory: C:\Users\AbdulAzeez\Desktop
Output:
This is not the first time, i'm creating a nuxt-project, I'm just getting this Error recently!
I even tried using npx, the same Error
Try to use the LTS version of node.js, the v14 is not stable. The current LTS version is 12.17.0 or see this link for the official LTS version if you are seen this in the future ( https://nodejs.org/en/download/)
after that run >>>
npx create-nuxt-app <project-name>

ern create-miniapp fails on Windows machine

Hi everyone,
I am new to mini apps but I followed the documentation of [Electrode native]
(https://native.electrode.io/v/v0.31/quick-start/getting-started) and [this]
(https://github.com/electrode-io/electrode-native).I am facing same issue again and again. My
installation versions are -
electrode-native: 1.0.17
ern platform: 0.40.0
node version - 9.1.0
react-native-cli: 2.0.1
I am trying to create a new project using ern create-miniapp MovieListMiniApp but getting
this error. The yarn file is already at this location .ern\versions \0.40.0\node_modules\ern-
core\node_modules\.bin\yarn but its continuously telling me
'Error: spawn .ern\versions\0.40.0\node_modules\ern-core\node_modules.bin\yarn ENOENT
events.js:196
throw er; // Unhandled 'error' event
^
Error: spawn C:\Users.ern\versions\0.40.0\node_modules.bin\yarn ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:266:19)
at onErrorNT (internal/child_process.js:468: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:272:12)
at onErrorNT (internal/child_process.js:468:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: -4058,
code: 'ENOENT',
syscall: 'spawn C:\Users.ern\versions\0.40.0\node_modules.bin\yarn',
path: 'C:\Users.ern\versions\0.40.0\node_modules.bin\yarn',
spawnargs: [ 'info', 'test-miniapp', 'versions', '--json' ]
}'
Please help me. Thanks in advance.
I tried a lot and researched much but found no luck. So ultimately I find out that the problem was with Window machine . When I tried on mac machine worked fine and the root cause was that Electrode Native is still not very mature and its not compatible with Windows architecture. So better use mac or in generic Linux based machine until the mini app team fix it.