My package.json file has devDependency for jquery as
"jquery": "^3.3.1",
I ran an npm install, build and then npm run dev after that.
My default blade template file has the scripts loading in the bottom as
<script src="{{ mix('/js/app.js') }}"></script>
@yield('js')
and I am using javascript in my view as
@section('js')
<script type="text/javascript">
$(document).ready(function(){
$('#centerhead').click(function(){
alert('test js');
});
});
</script>
@stop
yet I am getting Uncaught ReferenceError: $ is not defined
error on the console when I am trying to use jQuery. Javascript works fine though.