如何使用yarn安装bootstrap 4 - libsass库

18

我正在尝试在最新的项目中使用yarn。如何使用yarn安装bootstrap 4 - libsass库

6个回答

23

注意:

我刚刚意识到使用npm installyarn进行安装之间的差异。

这是我使用的两个命令:

yarn add bootstrap@4.0.0-alpha.6 --dev
npm install bootstrap@4.0.0-alpha.6 --save-dev

Bootstrap 4.0.0-alpha.6的正确/最新版本包含此文件:

/node_modules/bootstrap/scss/_tags.scss

使用npm安装时,这个文件正常存在。但如果使用yarn安装,这个文件就会缺失。即使在package.json中将bootstrap@^4.0.0-alpha.6更改为bootstrap@4.0.0-alpha.6也无法解决此问题。


请访问 GitHub 页面 https://github.com/twbs/bootstrap/releases 查看最新版本。 - Serhii Polishchuk
Bootstrap是否应该作为开发依赖项(--dev)?这些资源在运行时是必需的。 - rgov
@rgov 我会说不,因为样式在生产模式下也需要存在。 - Sam

6
yarn add bootstrap@4

安装最新的Bootstrap 4版本(截至'21年8月为4.6.0)


你随时可以使用

yarn add your_package@^

查看所有可用版本


2

只需运行:

yarn add bootstrap@4.0.0-alpha.6
yarn add gulp-sass --save-dev

1

要查找最新的安装说明,请参阅 GitHub 存储库:

https://github.com/twbs/bootstrap

截至本帖发布时,通过yarn安装最新的Bootstrap v4 beta版本的指令如下:
yarn add bootstrap@4.0.0-beta.2

0

Bootstrap 4 现在已经进入测试版,因此您可以执行以下操作:

yarn add bootstrap@4.0.0-beta

-1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接