2

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?

gfels
  • 2,557
  • 8
  • 27
  • 51

2 Answers2

2

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

gfels
  • 2,557
  • 8
  • 27
  • 51
1

You should install jQuery via npm or yarn.

npm install -S jquery

yarn add jquery