Appium - Android - Error: spawn appium ENOENT - webdriver-io

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.

Related

Unable to run local version of testcafe via npm link

Whenever I try to run a locally installed version of testcafe, I get the error Cannot find module '../testcafe/lib/cli'. Steps I've taken:
git clone <testcafe>, then cd to testcafe
npm install
npm link
cd to repo where my automated tests reside
npm link testcafe
Run testcafe <browser>
Results in
internal/modules/cjs/loader.js:796
throw err;
^
Error: Cannot find module '/Users/rcooper/testcafe/lib/cli'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:793:17)
at Function.Module._load (internal/modules/cjs/loader.js:686:27)
at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
at internal/main/run_main_module.js:17:11 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Is there something else I need to do, to run a local version of this library?
You need to build the TestCafe package. Run npx gulp build before the npm link command.

Failed to start the app. Run CLI with --verbose flag for more details

Error: Command failed: adb shell am start -n com.getgroceryapp/com.getgroceryapp.MainActivity
at makeError (F:\desuvit\projects\workingbranch\MobileApp\node_modules\execa\index.js:174:9)
node version: 12.4.0
npm version: 6.14.7
Using these command for running the app: 1)react-native run-android or npx react-native run-android
also same error
after i upgraded to v12.18.3(node version) also same error.
but i'm trying to run the project getting above error
please help me
advance thanks....
Open Android Studio File -> Project Structure -> Gradle Settings -> Gradle JDK
and set up as
Embedded JDK
This worked for me after trying so many other options.
If you previously installed a global react-native-cli package, please remove it as it may cause unexpected issues:
npm uninstall -g react-native-cli #react-native-community/cli

internal/modules/cjs/loader.js:584 issue

I got a problem when I input any npm cmd, it says
internal/modules/cjs/loader.js:584
Operating System: Windows 10 64bit
What shall I do to solve this issue?
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module 'E:\FED\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
For many people on Mac (not sure about Windows/Linux), the solution is:
Delete node_modules and package-lock.json, then run $ npm install again.
You can also try updating your version of node.
Check version with $ node -v,
install with $ sudo n stable
I was having a similar error but it was because I hadn't had my node_modules(the ones you deleted ) file open in the file I was working on, even though I had run npm Install.
my Error was
Cannot find module _resolveFilename
If you build and deploy another place at a later time for example in an docker image, it may help to bundle the dependencies that the loader cannot find in package.json. Then the packaged are bundled and the loader can find them.
"bundledDependencies": [ "express", "express-http-proxy", ],
"dependencies": { ...}
Before starting any project you have to write this command npm init --yes

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:

electron install error : Generated checksum for "electron-v2.0.2-win32-x64.zip" did not match expected checksum

I want to install latest electron version in my existing angular application.So I followed npm command to install it.
Command : npm i electron#latest
Expected Behavior
Electron should installed successfully.
Actual Behavior
So, Whenever I tried to install electron, after downloading zip file and SAMSUN.txt file , it is throwing below error....
Error: Generated checksum for "electron-v2.0.2-win32-x64.zip" did not match expected checksum.
at ChecksumMismatchError.ErrorWithFilename (E:\CityLawElectron\node_modules\electron-download\node_modules\sumchecker\build.js:41:124)
at new ChecksumMismatchError (E:\CityLawElectron\node_modules\electron-download\node_modules\sumchecker\build.js:56:133)
at Hash. (E:\CityLawElectron\node_modules\electron-download\node_modules\sumchecker\build.js:203:22)
at emitNone (events.js:106:13)
at Hash.emit (events.js:208:7)
at emitReadable_ (_stream_readable.js:513:10)
at emitReadable (_stream_readable.js:507:7)
at addChunk (_stream_readable.js:274:7)
at readableAddChunk (_stream_readable.js:250:11)
at Hash.Readable.push (_stream_readable.js:208:10)
Please note that I have tried to clear my npm cache using npm cache clean --force command and tried to install. but it didn't work.
I also tried to install electron globally using npm i -g electron#latest, but that approach also didn't work.
Please provide solution as soon as possible because I m really stuck at this problem.
Electron Version: 2.0.2
Operating System : windows
node version : 8.11.2
npm version : 6.1.0
Last known working Electron version:
We can solve this issue by using following steps (OS - Windows 10)
Delete "SHASUMS256.txt-x.x.xx" file from "C:\Users{{UserName}}.electron".
Delete Cache folder from "C:\Users{{UserName}}\AppData\Local\electron".
Delete electron from node_modules folder.
Then install electron globally and locally by using following commands -
npm init -y //Note: The -y flag provides default options automatically
npm install electron -g //install electron globally
npm install electron --save-dev --save-exact //install electron as devdependencies
If you are using typescript then install it as global using below command-
npm install -g typescript
Above steps may help you.