`yarn global add remotedev-server` gives error `Usage Error: The 'yarn global' commands have been removed in 2.x - use 'yarn dlx' instead` - google-chrome-extension

I am trying to run a local Dev build of Metamask Chrome Extension.
According to their README files Yarn3 should be installed and then to run React Dev Tools and Redux Dev Tools you to have install remotedev-server package with yarn global.
Yarn returns the following error - Usage Error: The 'yarn global' commands have been removed in 2.x - consider using 'yarn dlx' or a third-party plugin instead
Using yarn dlx does not help it gives the following error (see image) my Terminal output logs
I have tried installing the classic yarn that has version 1.22.19 but MetaMask package.json file has locked the yarn version at 3.2.4.
Has anyone faced this issue. Am I missing something. I have tried following one github discussion about this but with no success.

Related

NEAR protocol - dev env set up on Windows 10 - error when executing npx create-near-app#latest

I am trying to set up the development env on Windows 10. Installed Node.js, yarn and RUST on windows. Then to set up the project, I tried "npx create-near-app#latest" and was prompted to install WSL.. which I did. I re-executed 'npx' command in ubuntu terminal that got installed with WSL but am still getting the same error:
s_wankhede#Sharad-Asus:~$ npx create-near-app#latest
'\wsl$\Ubuntu\home\s_wankhede'
CMD.EXE was started with the above path as the current directory.
UNC paths are not supported. Defaulting to Windows directory.
======================================================
👋 Welcome to NEAR! Learn more: https://docs.near.org/
🔧 Let's get your dApp ready.
======================================================
(NEAR collects anonymous information on the commands used. No personal information that could identify you is shared)
Notice: On Win32 please use WSL (Windows Subsystem for Linux).
https://docs.microsoft.com/en-us/windows/wsl/install
Exiting now.
Questions:
Should I be installing Node.js, yarn and RUST in ubuntu (WSL on windows 10)?
What can I do solve the problem?
OK. Finally I could figure it out after reading lot of articles and lots of trial and error. Here are the simple steps to resolve it and of course these are for machines running Windows.
Install Linux on Windows with WSL - https://learn.microsoft.com/en-us/windows/wsl/install This MUST be the first step
Install Node.js https://nodejs.org/en/download/
Install RUST - (I am writing contracts in RUST) - https://doc.rust-lang.org/book/ch01-01-installation.html Also add wasm toolchain: rustup target add wasm32-unknown-unknown
Install Yarn : npm install -g yarn
Set up the project : npx create-near-app#latest

error: Expected node to be of a type ["Statement"] but instead got "AssignmentExpression" | React Native IOS

I'm having this problem when trying to run react native app on ios emulator.
I literally just created the project running npx react-native init app_test and when I run npx react-native run-ios I got this error.
I'm not installing dependencies or pods or anything. Just running yarn start when the app init is done and trying to run the emulator. Any suggestion by any chance plz?
Error in console:
error: node_modules/react-native/Libraries/Image/ImageAnalyticsTagContext.js: Property body[6] of BlockStatement expected node to be of a type ["Statement"] but instead got "AssignmentExpression"
You may want to check this solution out: https://github.com/facebook/react-native/issues/31960#issuecomment-893176992.
It seems there is a problem with #babel/plugin-transform-react-display-name#7.15.0 which has been released along with #babel/core#7.15.0 a couple of hours ago.
You may want to resolve the warnings after running 'yarn' or 'npm install'.
One of the relevant warnings is
warning "react-native > react-native-codegen > jscodeshift#0.11.0" has unmet peer dependency "#babel/preset-env#^7.1.6".
I was able to resolve this issue by running:
yarn add #babel/preset-env#^7.1.6 -D
Edit: Spoke too soon. That did not resolve the issue.
I found a solution:
Download the #babel folder from here and replace the existing folder in node_modules and it works:
https://drive.google.com/file/d/1-z_4H_z4x075unZqZD41WYUwY_hsrKox/view
"resolutions": {
"#babel/plugin-transform-react-display-name": "7.14.5"
}
add this in your package.json, and use yarn
I figured it out, for people who are starting react-native as me, I'll explain what I did with detail. (I'm using Window10)
I did almost everything in StackOverflow to solve my problem. As you can see in many answers this problem is caused by babel.
I bet you download "yarn" while set up, you need to remove and re-download babel using yarn.
So, you need to put this below in your project root dir cmd
$ yarn remove babel-preset-react-native
$ yarn add babel-preset-react-native#2.1.0
But for me, this caused problem Bug: Yarn fails to install (Exit code: 128). So, I had to remove yarn and re-download using below
So I had to clean my cache to remove and re-downlaod yarn.lock using
$ yarn cache clean
$ del yarn.lock
(I didn't use this but maybe you need to erase node_modules file as well)
$ yarn
Then, I put below in my project's package.json below the "jest"
"resolutions": { "#babel/plugin-transform-react-display-name": "7.14.5" }
For last, run my project using below.
$ react-native run-android
Hope this work for you as well it did for me.

The webdriver module is not found when run a custom sample with botium-cli?

I'm working on Windows 10, and I trying to run the custom sample that was cloned from https://github.com/codeforequity-at/botium-connector-webdriverio.git
I've already installed this components, following the steps into the links:
*Automation Tests: https://ichi.pro/es/botium-en-pocas-palabras-parte-3-automatizacion-de-pruebas-de-chatbot-119084922769950
*Install Webdriverio and selenium: https://github.com/codeforequity-at/botium-connector-webdriverio
Basically, I have executed the following commands from my project path:
*npm install -g botium-cli npm install -g botium-connector-webdriverio
*botium-cli init
*botium-cli run
Note: To run the tests I'm using the following command, after start selenium:
botium-cli run --config C:\Botiumsample\samples\custom\botium.json --convos C:\Botiumsample\samples\custom\spec\convo
This is the output that I'm getting:
Error: Loading Botium Plugin failed.
Loading Botium plugin from webdriverio failed - Cannot find module 'webdriverio'
Require stack:
- C:\Users\myuser\AppData\Roaming\npm\node_modules\botium-cli\node_modules\botium-
core\src\containers\plugins\index.js
- C:\Users\myuser\AppData\Roaming\npm\node_modules\botium-cli\node_modules\botium-
core\index.js
- C:\Users\myuser\AppData\Roaming\npm\node_modules\botium-cli\src\run\index.js
- C:\Users\myuser\AppData\Roaming\npm\node_modules\botium-cli\bin\botium-cli.js
Loading Botium plugin botium-connector-webdriverio failed, try "npm install botium-
connector-webdriverio" - Cannot find module 'botium-core'
Require stack:
- C:\Users\myuser\AppData\Roaming\npm\node_modules\botium-connector-
webdriverio\dist\botium-connector-webdriverio-cjs.js
- C:\Users\myuser\AppData\Roaming\npm\node_modules\botium-cli\node_modules\botium-
core\src\containers\plugins\index.js
- C:\Users\myuser\AppData\Roaming\npm\node_modules\botium-cli\node_modules\botium-
core\index.js
- C:\Users\myuser\AppData\Roaming\npm\node_modules\botium-cli\src\run\index.js
- C:\Users\myuser\AppData\Roaming\npm\node_modules\botium-cli\bin\botium-cli.js
at tryLoadPlugin (C:\Users\myuser\AppData\Roaming\npm\node_modules\botium-
cli\node_modules\botium-core\src\containers\plugins\index.js:133:9)
at PluginConnectorContainer.Validate
(C:\Users\myuser\AppData\Roaming\npm\node_modules\botium-cli\node_modules\botium-
core\src\containers\PluginConnectorContainer.js:14:27)
Despite the response, I can see the webdriverio module in this path:
C:\Users\myuser\AppData\Roaming\npm\node_modules\botium-connector-webdriverio\node_modules\webdriverio
Please any idea about this error?. Thanks
This has to do with how Node.js is resolving modules. You can read about this topic in lots of places over the internet, for example here. But in short:
Botium Core is installed as nested package of Botium CLI
Botium WebdriverIO Connector is installed outside
Botium Core is not visible to the Botium WebdriverIO Connector module
Several options available:
Install Botium Core as global module on the top level as well:
npm install -g botium-cli botium-core botium-connector-webdriverio
Install everything in a local project directory (recommended - project directory can be put under git control with all dependencies):
npm init --yes && npm install botium-cli botium-connector-webdriverio
npx botium-cli init
npx botium-cli run

ng e2e is failing, for chrome driver download location becomes unreachable

from yesterday, all of a sudden ng e2e is failing during chromedriver setup step... not having a clue.
OS - Ubuntu 18.04
Node - 13.12.0 [also tested in 12.0.0, same error]
Angular CLI - 8.3.25
Solved the problem, for e2e running with angular cli. Follow the steps below, anyone facing same problem. In my country, the download URL for chrome driver became unreachable.
0) use a VPN for downloading the chromedriver, a specific one you need. the idea is not checking for update every test run. I used protonvpn's free service.
1) install protractor globally
npm install protractor -g
update webdriver manager with specific version of chrome driver
webdriver-manager update --versions.chrome=80.0.3987.163
2) locate the selenium folder in the global installation, for me its
/home/adnan/.nvm/versions/node/v12.0.0/lib/node_modules/protractor/node_modules/webdriver-manager/selenium
3)
copy the contents to a folder, 'selenium-backup' inside your e2e folder
4) update protractor.conf.js, with something like this, a relative location respect to your protractor.conf.js
exports.config = {
....
chromeDriver: './e2e/selenium-backup/chromedriver_80.0.3987.163',
....
}
ref: https://github.com/angular/protractor/blob/master/lib/config.ts
5) have a script defined in your angular application's package.json
"e2e-xu": "ng e2e --webdriverUpdate=false"
6) to run the e2e, use this command
npm run e2e-xu
7) make sure your CI environment download chrome of version 80.0.3987.163 , rather than latest stable

Cypress failed to start on MacOS

When I try to use cypress open or cypress run, I get the following error:
✖ Verifying Cypress can run /*/*/.cache/Cypress/3.1.5/Cypress
→ Cypress Version: 3.1.5
Cypress failed to start.
This is usually caused by a missing library or dependency.
The error below should indicate which dependency is missing.
https://on.cypress.io/required-dependencies
If you are using Docker, we provide containers with all required dependencies installed.
----------
Command failed: /*/*/.cache/Cypress/3.1.5/Cypress/Cypress --smoke-test --ping=984
----------
Platform: darwin (17.6.0)
Cypress Version: 3.1.5
There are no dependencies listed in the error, and I'm not using docker. What should I try?
Simply try ./node_modules/.bin/cypress install if you're using Cypress for the first time.
One thing that worked for me was unsetting the NODE_OPTIONS environment variable:
on MacOS
unset NODE_OPTIONS
cypress open
on Windows
set NODE_OPTIONS=
cypress open
if that fails, try the following as suggested by a user on Github:
on MacOS:
clear /Users/[username]/Library/Caches/Cypress
run npm i cypress -g
run cypress open
close terminal
return back to your node.js project and run the tests
on Windows:
clear C:\Users[username]\AppData\Local\Cypress\Cache)
start a command prompt as administrator
run npm i cypress -g
run cypress open
close command prompt
return back to your node.js project and run the tests

Resources