首页 > 解决方案 > Ember 构建问题:“不能同时使用 decorators 和 decorators-legacy 插件”

问题描述

我最近在使用 bitbucket 管道构建我的 ember 项目时遇到了一个问题:

+ ember build --environment="production"
Could not start watchman
Visit https://ember-cli.com/user-guide/#watchman for more info.
Building
Environment: production
cleaning up
cleaning up...
Build Error (broccoli-persistent-filter:Babel > [Babel: ember-data]) in ember-data/adapters/json-api.js
Cannot use the decorators and decorators-legacy plugin together

我目前使用的是 ember-cli 版本 3.8.1。

所有构建环境都会出现此问题,而不仅仅是生产环境。让我感到困惑的是,在上次成功构建和此后一直失败的构建之间没有添加新的 npm 包或 ember 插件 - 现在如果我重新运行成功的构建,那也会失败。

我已经回到提交历史记录到一个有效的提交,然后一步一步快进到现在 - 总是删除 node_modules 并重新安装包。它总是在本地工作,但是当管道运行时它总是会失败。

我也尝试过更新我的 docker 镜像。

我已经尝试过这里列出的解决方案——但似乎它们已经在 3.8.1 版中得到解决。

另外,如果有任何帮助,这是我的 bitbucket-pipelines.yml:

pipelines:
  branches:
    master:
      - step:
         name: Building Ember Project
         script:
          - npm install
          - npm install firebase-tools
          - ember build --environment="production"
      - step:
         trigger: manual
         deployment: production
         name: Deploy to Production
         script:
          - firebase use prod
          - firebase deploy --non-interactive --token ${FIREBASE_TOKEN}

谢谢大家!

标签: ember.jsember-datababeljsbitbucket-pipelinesbroccolijs

解决方案


这听起来像是在引擎盖下动态更改的子依赖项。你有一个 npm 或 yarn 锁文件作为你的 repo 的一部分提交吗?锁定文件专门设计用于防止遇到这样的障碍


推荐阅读