【问题标题】:ReferenceError: primordials is not defined error when installing Semantic UIReferenceError: primordials is not defined 安装语义 UI 时出现错误
【发布时间】:2020-10-14 22:14:56
【问题描述】:

我知道这个问题已被问过很多次(例如 - here),但要么解决方案不起作用,要么不适合我的情况。 上面链接中提供的解决方案是:

解决方案:升级到 gulp 4 或降级到更早的节点。

所以,这就是我所拥有的:

• 节点:12.18.1 (node -v)

• Gulp:CLI 2.3.0,本地版本 4.0.2 (gulp -v)

我创建了全新的 react 应用:

npx create-react-app --template typescript react-app

然后我进入应用文件夹(react-app)并在Semantic UI站点上执行以下命令:

npm install semantic-ui --save

但是,我收到与上述问题相同的错误。这是此命令的完整输出:

【问题讨论】:

    标签: node.js npm gulp semantic-ui


    【解决方案1】:

    如果您不想回滚 Node 版本,请尝试使用积极维护的 Semantic UI 社区分支:Fomantic UI

    像使用语义 ui 一样运行命令:npm i fomantic-ui

    Fomantic 与 Semantic UI 向后兼容,同时解决了 Node 12 和 Gulp 3 之间的兼容性问题(another thread 将其称为“原始未定义”问题的根源)。

    【讨论】:

    • 这对我有用...我在 Linux 构建按原样工作的 Windows 构建上遇到了麻烦。 Gulp 不会在 Windows 上更新到 4 - 到 3.9。
    • 这应该是接受者的答案。感谢您的帮助 ;-)
    【解决方案2】:

    尝试回到 Node v10。 问题是 Node v12 具有与 Semantic-UI (Gulp 4.0.2) 不兼容的功能,这就是您收到错误的原因。

    【讨论】:

      【解决方案3】:

      请尝试在https://nodejs.org/en/download/ 将您的 node.js 升级到最新版本

      并运行以下命令 npm install -g npm@7.0.9 或最新版本来更新你的 npm。 升级和更新 Node 和 npm 后,我安装了语义 UI,但没有收到 primordial not defined 错误

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2022-10-24
        • 2020-10-24
        • 1970-01-01
        • 2021-01-16
        • 2019-09-19
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多