1

I've installed Jetstream and Livewire to my Laravel 8 project. But i couldn't figure out how to include JQuery and Bootstrap to my project. How can i do that?

EDIT: Bootstrap part is understood but still can't install Jquery.

JQUERY part

As @codedge said i tried to run npm require jquery command both in my project folder and in somewhere else and it gave me this output:

Usage: npm <command>

where <command> is one of:
    access, adduser, audit, bin, bugs, c, cache, ci, cit,
    clean-install, clean-install-test, completion, config,
    create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
    edit, explore, fund, get, help, help-search, hook, i, init,
    install, install-ci-test, install-test, it, link, list, ln,
    login, logout, ls, org, outdated, owner, pack, ping, prefix,
    profile, prune, publish, rb, rebuild, repo, restart, root,
    run, run-script, s, se, search, set, shrinkwrap, star,
    stars, start, stop, t, team, test, token, tst, un,
    uninstall, unpublish, unstar, up, update, v, version, view,
    whoami

npm <command> -h  quick help on <command>
npm -l            display full usage info
npm help <term>   search for help on <term>
npm help npm      involved overview

Specify configs in the ini-formatted file:
    C:\Users\YARKIN\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

npm@6.14.10 D:\nodejs\node_modules\npm

Did you mean this?
    rebuild

EDIT-2: I can't add Jquery to my public\js\app.js eventhough i have is installed and required it it resources\js\app.js.

  • 1
    Does this answer your question? [Laravel 8 JetStream Bootstrap 4](https://stackoverflow.com/questions/65779746/laravel-8-jetstream-bootstrap-4). There is also [this video](https://www.youtube.com/watch?v=Pd7EF2rkyOM) if you're more of a visual learner. – Peppermintology Jan 28 '21 at 12:38
  • @Unflux thank you sir/madam! –  Jan 28 '21 at 13:11

1 Answers1

2

Jetstream does not support Bootstrap and jQuery - this is by intention as explained in this Github issue.

There is a package that brings the support for Bootstrap to Jetstream: https://github.com/nascent-africa/jetstrap

jQuery can be installed via npm install jquery and required in your app.js.

codedge
  • 4,754
  • 2
  • 22
  • 38
  • I got the Bootstrap part. But couldn't install jquery with above command it suggests me rebuild command. –  Jan 28 '21 at 13:12
  • Can you share your steps you did and what error message is dplayed? Please update your original post. – codedge Jan 28 '21 at 13:14
  • i've edited it hope it gives the information that you need. –  Jan 28 '21 at 13:19
  • 1
    Sorry, it is `npm install ...` :( – codedge Jan 28 '21 at 13:35
  • Here is the thing @codedge, i've downloaded it and added `require('jquery')` but still jquery doesn't work. –  Jan 28 '21 at 18:16
  • `window.$ = require('jquery');` .. and there are multiple tutorial, documentations and SO threads how to add jquery. Please help yourself. – codedge Jan 28 '21 at 18:21