Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React - jquery module not found

I have loaded jquery via the npm, and I am trying to import jQuery in App.js of my React app like so:

import $ from 'jquery';

But it says:

Module not found: Can't resolve 'jquery'

Any idea what could be wrong here?

like image 472
gfels Avatar asked Feb 23 '26 17:02

gfels


2 Answers

I didn't come up with a solution however doing an nmp install fixed this.

like image 97
gfels Avatar answered Feb 25 '26 06:02

gfels


You should install jQuery via npm or yarn.

npm install -S jquery

yarn add jquery
like image 44
Stefan Maretić Avatar answered Feb 25 '26 06:02

Stefan Maretić



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!