Liferay 主题创建:gulp 构建和 gulp 部署期间出错

Liferay Theme Creation : Error During gulp build and gulp deploy

安装所有必要的软件包后,我正在尝试为 Liferay 7.3 版本构建一个主题。 我已经安装了所有需要的包,例如 nodejs、npm、gulp ad ruby(sass 和 compass)。

执行 gulp 构建后,出现以下错误:

Deprecation Warning: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($spacer, 2)

    ╷
306 │ $headings-margin-bottom:      $spacer / 2 !default;
    │                               ^^^^^^^^^^^
    ╵
    build/_css/clay/bootstrap/_variables.scss 306:31  @import
    build/_css/clay/base.scss 10:9                    @import
    build/_css/clay.scss 1:9                          root stylesheet

Deprecation Warning: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($input-padding-y, 2)


    ╷
501 │ $input-height-inner-quarter:            add($input-line-height * .25em, $input-padding-y / 2) !default;
    │                                                                         ^^^^^^^^^^^^^^^^^^^^
    ╵
    build/_css/clay/bootstrap/_variables.scss 501:73  @import
    build/_css/clay/base.scss 10:9                    @import
    build/_css/clay.scss 1:9                          root stylesheet

Deprecation Warning: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($custom-control-indicator-size, 2)


    ╷
571 │ $custom-switch-indicator-border-radius:         $custom-control-indicator-size / 2 !default;
    │                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ╵
    build/_css/clay/bootstrap/_variables.scss 571:49  @import
    build/_css/clay/base.scss 10:9                    @import
    build/_css/clay.scss 1:9                          root stylesheet

Deprecation Warning: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($spacer, 2)


    ╷
717 │ $nav-divider-margin-y:              $spacer / 2 !default;
    │                                     ^^^^^^^^^^^
    ╵
    build/_css/clay/bootstrap/_variables.scss 717:37  @import
    build/_css/clay/base.scss 10:9                    @import
    build/_css/clay.scss 1:9                          root stylesheet

Deprecation Warning: Using / for division is deprecated and will be removed in Dart Sass 2.0.0.

Recommendation: math.div($spacer, 2)


    ╷
722 │ $navbar-padding-y:                  $spacer / 2 !default;
    │                                     ^^^^^^^^^^^
    ╵
    build/_css/clay/bootstrap/_variables.scss 722:37  @import
    build/_css/clay/base.scss 10:9                    @import
    build/_css/clay.scss 1:9                          root stylesheet

[10:56:46] 'build:compile-css' errored after 13 s
[10:56:46] Error in plugin "sass"
Message:
    build/_css/compat/components/_dropdowns.scss
Error: compound selectors may no longer be extended.
Consider `@extend .dropdown-item, .disabled` instead.

   ╷
34 │         @extend .dropdown-item.disabled;
   │                 ^^^^^^^^^^^^^^^^^^^^^^^
   ╵
  build/_css/compat/components/_dropdowns.scss 34:11  root stylesheet
Details:
    formatted: Error: compound selectors may no longer be extended.
Consider `@extend .dropdown-item, .disabled` instead.

   ╷
34 │         @extend .dropdown-item.disabled;
   │                 ^^^^^^^^^^^^^^^^^^^^^^^
   ╵
  build/_css/compat/components/_dropdowns.scss 34:11  root stylesheet
    line: 34
    column: 11
    file: /home/osboxes/liferayExercise/my-liferay-theme/build/_css/compat/components/_dropdowns.scss
    status: 1
    messageFormatted: build/_css/compat/components/_dropdowns.scss
Error: compound selectors may no longer be extended.
Consider `@extend .dropdown-item, .disabled` instead.

   ╷
34 │         @extend .dropdown-item.disabled;
   │                 ^^^^^^^^^^^^^^^^^^^^^^^
   ╵
  build/_css/compat/components/_dropdowns.scss 34:11  root stylesheet
    messageOriginal: compound selectors may no longer be extended.
Consider `@extend .dropdown-item, .disabled` instead.

   ╷
34 │         @extend .dropdown-item.disabled;
   │                 ^^^^^^^^^^^^^^^^^^^^^^^
   ╵
  **build/_css/compat/components/_dropdowns.scss 34:11  root stylesheet
    relativePath: build/_css/compat/components/_dropdowns.scss
    domainEmitter: [object Object]
    domainThrown: false**

[10:56:46] 'build' errored after 19 s

软件包版本为:

节点:12.22.7
Npm:6.14.15
Gulp :CLI 版本: 2.3.0 ,本地版本: 4.0.0

注意:我无法编辑这些文件,因为它们是自动生成的。所以我不能改变那些。

我有同样的问题,但您可以通过覆盖文件来解决:

  1. 进入您的 src 文件夹
  2. 如果您没有创建 css 文件夹
  3. 然后创建/compat/components/_dropdowns.scss
  4. 现在您可以覆盖文件
  5. 运行 构建命令,大功告成!

同样的事情发生在我身上,直到我删除我的 ^16 节点版本和我的 yeoman 版本,我才重新安装节点的 10.16.3 版本,你的 3.1.1 版本,gulp 的 4.0.2 版本,然后按照这个指南一步一步: https://help.liferay.com/hc/es/articles/360028834632-Installing-the-Theme-Generator-and-Creating-a-Theme (除了第 3 步,我不需要安装 node-gyp 和 Python,虽然这可能是个好主意)。之后就可以正常部署了。