Cannot manage to install jest
Cannot manage to install jest
I am using npm
to install jest
in order to perform some tests over my js code.
In order to install it I use the command:
npm
jest
$ npm install --save-dev jest
As described on their website.
However, it fails over and over again with these errors:
What should I do in order to install jest
properly?
jest
This is my package.json :
"name": "my-app",
"version": "0.1.0",
"private": true,
"devDependencies":
"babel-preset-env": "^1.7.0",
"jest": "^23.5.0",
"react-scripts": "0.6.1"
,
"dependencies":
"adal-angular": "^1.0.13",
"axios": "^0.15.3",
"bootstrap": "^3.3.7",
"jquery": "^3.1.1",
"lodash": "^4.16.4",
"react": "^15.4.2",
"react-bootstrap": "^0.30.5",
"react-bootstrap-typeahead": "^1.2.0",
"react-dom": "^15.4.2",
"react-http-request": "^1.0.2"
,
"scripts":
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
,
"description": "This project was bootstrapped with [Create React App]
(https://github.com/facebookincubator/create-react-app).",
"main": "index.js",
"author": "",
"license": "ISC"
Current message:
enter image description here
rn -rf node_modules
npm cache clean --force
1 Answer
1
Please install react v16 for this:
npm install --save react@^16.4.2 react-dom@^16.4.2
then run this command:
npm update --save
to get all dependent packages
I did but still get the same message..
– I.zvi
Aug 30 at 9:16
please share your
package.json
– Sakhi Mansoor
Aug 30 at 9:17
package.json
Ok, edited my question it's now there.
– I.zvi
Aug 30 at 9:42
it says react is v15
– Sakhi Mansoor
Aug 30 at 9:43
I surely installed v16.. Should I change it manually or is there any other way to update it ?
– I.zvi
Aug 30 at 9:46
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
doesn't look like anything to do with jest or react, I'd try
rn -rf node_modules
(or Win equivalent) and maybe clear npm cachenpm cache clean --force
and try again.– lecstor
Aug 29 at 13:34