lundi 20 juillet 2020

How can I solve "cannot find module" when npm test

I am using create-react-app. When I input 'npm test', an error occurring "Cannot find module". I though jest is already installed in create-react-app. The following is my package.json. Any ideas?

{
  "proxy": "http://localhost:5000",
  "name": "276_project",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.5.0",
    "@testing-library/user-event": "^7.2.1",
    "axios": "^0.19.2",
    "bulma": "^0.9.0",
    "jwt-decode": "^2.2.0",
    "node-sass": "^4.14.1",
    "react": "^16.13.1",
    "react-bootstrap": "^1.2.2",
    "react-cart-components": "^2.1.0",
    "react-dom": "^16.13.1",
    "react-hook-form": "^5.7.2",
    "react-router-dom": "^5.2.0",
    "react-scripts": "3.4.1",
    "react-stripe-checkout": "^2.6.3",
    "react-toastify": "^6.0.6",
    "serve": "^11.3.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "heroku-postbuild": "npm run build"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

Aucun commentaire:

Enregistrer un commentaire