mardi 1 octobre 2019

"react-scripts test --env=jsdom" conflict with "webpack"

I created new react.js project manually (without using create-react-app). I use webpack webpack-cli and webpack-dev-server for building and running my app. recently I installed jasmine and added test folder and simple test describe/it functions. but when I try to run my test with "test": "react-scripts test --env=jsdom" command I get below errors:

To fix the dependency tree, try following the steps below in the exact order:

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your >project folder.
  2. Delete node_modules in your project folder.
  3. Remove "webpack" from dependencies and/or devDependencies in the >package.json file in your project folder.
  4. Run npm install or yarn, depending on the package manager you use.

when I uninstalled webpack from my project this problems fixed. but I need both webpack and my test.

How to I can fix this conflict?

Aucun commentaire:

Enregistrer un commentaire