После создания приложения реагирования с помощью команды create-Reaction-app до сих пор все шло успешно. Я сделал рабочий проект реагирования. Но теперь, когда я пытаюсь реализовать юнит-тестирование с шуткой.
Использование npm для установки: 'npm install --save-dev jest'
Затем запускаем: npm ls jest Я заметил, что реагирующий скрипт ищет версию jest, которая значительно старше.
package.json:
"dependencies": {
"react": "^16.8.1",
"react-dom": "^16.8.1",
"react-redux": "^6.0.0",
"react-scripts": "2.1.5",
"redux": "^4.0.1"
},
"devDependencies": {
"jest": "^24.7.1"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "jest",
"eject": "react-scripts eject"
}
npm ls Шутный результат:
+-- jest@24.7.1
`-- react-scripts@2.1.5
`-- jest@23.6.0
Ошибка запуска npm:
There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix
locally.
The react-scripts package provided by Create React App requires a
dependency:
"jest": "23.6.0"
Don't try to install it manually: your package manager does it
automatically.
However, a different version of jest was detected higher up in the tree:
C:\Users\userName\sample js codes\redux\songs\node_modules\jest (version:
24.7.1)
Есть ли решение для решения этой проблемы версии зависимости?