Jest Error: 'jest' is not recognized as an internal or external command, operable program or batch file
Try installing jest as a dev dependency.
npm install --save-dev jest
Then run it with npm test
. Don't use jest
command directly. It's not recommended.
If you want to use jest
command use node_modules/.bin/jest
.
I fixed this problem only after installing jest globally:
npm install -g jest
You can use "node_modules\.bin\jest" --init
if you are on Windows.