How to Install Bootstrap for Laravel using npm via Command Line in Linux Operating System

Posted on

This is an article depicting the process of how to install bootstrap using an utility called ‘npm’. The utility itself which is claimed as Javascript Package Manager is actually take part for managing dependency available in a certain web-based application project such as Laravel. So, using npm to manage it, in the context of installing a Javascript additional module such as ‘bootstrap’, that role can be taken by executing a single command. But to execute the command further, the ‘npm’ utility need to be checked first whether or whether not it has already been installed. Below is the output of the ‘npm’ command executed :

user@hostname:/var/www/html/laravel$ npm
Usage: npm 
where  is one of:
    access, adduser, bin, bugs, c, cache, completion, config,
    ddp, dedupe, deprecate, dist-tag, docs, doctor, edit,
    explore, get, help, help-search, i, init, install,
    install-test, it, link, list, ln, login, logout, ls,
    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  -h     quick help on 
npm -l           display full usage info
npm help   search for help on 
npm help npm     involved overview
Specify configs in the ini-formatted file:
    /home/user/.npmrc
or on the command line via: npm  --key value
Config info can be viewed via: npm help config
[email protected] /usr/local/lib/node_modules/npm
user@hostname:/var/www/html/laravel$ 

Below is how to install bootstrap using the ‘npm’ command :

user@hostname:/var/www/html/laravel$ npm install bootstrap
+ [email protected]
added 1 package in 0.664s
user@hostname:/var/www/html/laravel$ 

Soon after the command has successfully carried out, there will be a folder named ‘bootstrap’ located inside the folder named ‘node_modules’ which is located inside the root folder of Laravel web-based application project’s folder. It means that the bootstrap has already been added as an additional module that can be used in the Laravel web-based application project.

user@hostname:/var/www/html/laravel/node_modules$ ls -al
total 16
drwxrwxr-x  4 user    user 4096 Oct 31 11:31 .
drwxrwxr-x 17 user    user 4096 Oct 31 11:31 ..
drwxrwxr-x  7 user    user 4096 Oct 31 11:31 bootstrap
drwxrwxr-x  5 user    user 4096 Oct 31 11:28 jquery
user@hostname:/var/www/html/laravel/node_modules$ 

One thought on “How to Install Bootstrap for Laravel using npm via Command Line in Linux Operating System

Leave a Reply