首页 > 解决方案 > Use Semantic UI with Lerna and yarn workspaces

问题描述

The Semantic UI (and Fomantic UI) installer (famously?) doesn't support yarn because of its interactive postinstall script. Even with "autoInstall": true in semantic.json, yarn will still break on the first install.

This makes it hard to keep a themed Semantic UI installation in its own package in a Lerna monorepo, when using workspaces. Even if --ignore-scripts is added to Lerna's package.json scripts, it will still run a standard yarn install by itself every now and then when making changes, and become blocked by Semantic UI.

Is there a way around this?

标签: semantic-uiyarnpkglernayarn-workspaces

解决方案


事实上,你可以autoInstall使用 fomantic-ui 来使用 yarn,我只是运行了这些命令,它就成功了

$ yarn add fomantic-ui --ignore-scripts
$ yarn --cwd node_modules/fomantic-ui run install

语义.json

-  "autoInstall": false,
+  "autoInstall": true,

现在每次yarn install运行它都会“跳过”安装脚本。

确保您使用的是最新版本的 FUI

FUI repo https://github.com/fomantic/Fomantic-UI/issues/386上还有一个关于这个问题的完整问题


推荐阅读