I'm trying to use yarn for my latest project. How to install bootstrap 4 - libsass libraries using yarn
6 Answers
Attention:
I just realized a difference between the installations with npm install and yarn.
Here are the two commands I used:
yarn add bootstrap@4.0.0-alpha.6 --dev
npm install bootstrap@4.0.0-alpha.6 --save-dev
The correct/current version of bootstrap 4.0.0-alpha.6 contains this file:
/node_modules/bootstrap/scss/_tags.scss
Installed with npm, this file exists as expected. But installed via yarn, this file is missing. Even if changing bootstrap@^4.0.0-alpha.6 to bootstrap@4.0.0-alpha.6 in package.json didn't fix this issue.
- 26,852
 - 13
 - 75
 - 99
 
- 403
 - 4
 - 6
 
- 
                    actually see the last version at the github page https://github.com/twbs/bootstrap/releases – Serhii Polishchuk Jan 10 '18 at 16:19
 - 
                    Is bootstrap intended to be a development dependency (`--dev`)? The resources are needed at runtime. – rgov Jun 19 '20 at 17:52
 - 
                    @rgov I would say no because the stylings need to be there in production mode as well – Sam Aug 31 '21 at 21:41
 
yarn add bootstrap@4
installs the latest bootstrap 4 version (4.6.0 at aug/'21)
And you can always use
yarn add your_package@^
To view all the versions that are available
- 9,239
 - 7
 - 57
 - 79
 
- 1,765
 - 11
 - 82
 - 176
 
Just run:
yarn add bootstrap@4.0.0-alpha.6
yarn add gulp-sass --save-dev
- 26,852
 - 13
 - 75
 - 99
 
- 3,203
 - 7
 - 30
 - 52
 
To find the most current installation instructions, see github repo:
https://github.com/twbs/bootstrap
As of the time of this posting, instructions for installing the latest beta version of Bootstrap v4 via yarn is:
yarn add bootstrap@4.0.0-beta.2
- 1,550
 - 3
 - 21
 - 45
 
Bootstrap 4 is now in beta, so you can do the following:
yarn add bootstrap@4.0.0-beta
- 509
 - 9
 - 13