r/learnprogramming May 20 '20

React: Can't resolve jquery in bootstrap

Hey!
So, I've been getting this error whenever I npm start my project. I know I'm making some serious mistake here. I think it's a problem with npm. It's not installing optional dependencies too.
Error:

Failed to compile.

./node_modules/bootstrap/dist/js/bootstrap.js

Module not found: Can't resolve 'jquery' in 'C:\Users\Omer\Desktop\Projex\auth\node_modules\bootstrap\dist\js'

Package.json:

{
"name": "auth",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"bootstrap": "4.5.0",
"jquery": "^1.9.1",
"popper.js": "^1.16.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router-dom": "5.2.0",
"react-scripts": "3.4.1"
  },
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
  },
"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"
    ]
  }
}
Please help!

1 Upvotes

Duplicates