how do I check the version of Cypress I have installed via command line - version

I want to check the version I have of Cypress that is installed via the command line.
how do I check that
I have tried Cypress verify
and cypress version

You have to use command ./node_modules/.bin/cypress version to get the cypress version.

In the project folder type:
npx cypress --version

In the terminal type cypress -v or cypress --version

Use Git-Bash/Cmd, type "npx cypress --version". It will give Cypress package version, Cypress binary version, Electron and Bundled Node version also. Typing "./node_modules/.bin/cypress version" in cmd prompt will also give the same details.

Related

Typescript version in VScode

I have a CRA app in VSCode.
My global TS version is:
My project TS version is (package.json):
VSCode uses the latest:
Now, when I try to add a 4.0 TS feature, the terminal shows a compilation error:
I tried to change the package.json TS version to latest and ran npm install but it didn't help.
My Questions are:
Why doesn't it compile?
Which TS version is used for PROBLEMS pane and which for terminal? I would expect the same error in both locations.
Thanks in advance!
When you run tsc -v in the terminal, you are calling a globally installed Typescript package which is showing you have version 4.8.4 installed.
You can verify this by running npm list -g --depth 0 which will list all the global packages you have installed, along with their versions.
However, when using npm scripts (e.g in CRA npm run build) the Typescript package inside your node_modules folder is called. Since this version of Typescript is 3.x the compilation will fail. By changing VSCode to use the workspace version, the same error will be shown.
Upgrading the version inside your package.json to the latest should fix this error. To be sure the correct version is being used, try using an npm script to list the version by including this vers script in your package.json
"scripts": {
"...": "your other scripts",
"vers": "tsc -v"
}
then run npm run vers in your terminal.
TLDR:
Q1.
The Typescript version used when running the CRA build script (3.x)
is targeted which will fail when using 4.x syntax.
Q2.
The problems pane in VSCode uses the VSCode Typescript version
(depends how up to date your VSCode is) unless manually switched to
use the workspace version (node_modules version).
The terminal will target your globally installed version.
NPM scripts will target the version inside your node_modules folder.

React-native-reanimated: Unable to resolve "./useValue"

I am trying to build a react native app. I have caught an error on the terminal saying
Unable to resolve "./useValue" from "node_modules\react-native-reanimated\src\Animated.js"
I reinstalled react-native-reanimated to the expected version range.
`Some of your project's dependencies are not compatible with currently installed expo package version:
react-native-reanimated - expected version range: ~1.9.0 - actual version installed: ^1.10.1
Your project may not work correctly until you install the correct versions of the packages. To install the correct versions of these packages, please run: expo install [package-name ...]`
Thus, I run the code as follow: npm install react-native-reanimated#1.9.0, but still run into the error code.
I could realy use some help on this.
try uninstalling the package ==> close ide (all instances) ==> open the ide ==> install the package again ==> run "expo start -c"
Only do this:
expo start --clear
From Expo Documentation at Expo Start command.
--clear, -c | Clear the React Native Packager cache.

How do I fix my "No valid exports main found" compile error?

I tried to compile the files using
npm start
but it doesn't works.
In my chrome and terminal, it says like this way.
Failed to compile
./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-3-1!./node_modules/postcss-loader/src??postcss!./src/index.css)
Error: No valid exports main found for 'C:\Users\Jiwoo\Desktop\movie_app_2020\node_modules\colorette'
I tried to delete folder [node_modules] and typing "npm i" but it doesn't works too.
How can I fix my error?
upgrade node.js and also remove create-react-app globally by using below command
npm uninstall -g create-react-app
and using:
npx create-react-app myapp
I am using Windows 7 and the latest working Node version is 13.6. Therefore to make it run the only option is to downgrade autoprefixer: npm i autoprefixer#9.8.0
Downgrading colorette module to 1.2.0 didn't help.
The ultimate solution is to upgrade Node, however, it's not possible on Windows 7. Alternatively, one can try to compile it on a VM or with a docker image that supports Node 14+.
For windowss 7 user who are using any of the 12+ version just download the last 13 version which is v13.14.0. Before installing this version make sure to uninstall the previous version installed.
Here's the download link
Download the .msi file instead of exe file
Hope it will work
Thanks

Doesn't work "npx create-react-app my-new-app --typescript"

Please help me. When I try to generate a project (creative-react-app), I get an error, you can look in the screenshot. The screen also shows the versions of node, npm and npx. I am using Linux Ubuntu 18.04.4 LTS.
Try to uninstall your nightly Node version and install the stable version of Node. In the error, it says that babel isn't compatible with your version of Node.
It also could be that you have an old version of React installed locally. So if the first fix doesn't work try
npm uninstall react

How to check Current version of React using command prompt

I installed Reactjs using npm command creat-react-app. Now I want to check which version I installed
Run the command npm list react or npm ls react from the root directory of your project. Docs.
Just type the below command in your command prompt:
npm view react version
Example:
There are multiple ways to check react version in your project:
6 Different ways to Check React Version | Terminal
A great place to check for which version of React you have installed is in the package.json, which should be under node_modules/react/index.js

Resources