【问题标题】:Ember mismatch names in index.js and package.jsonindex.js 和 package.json 中的 Ember 名称不匹配
【发布时间】:2021-10-28 07:02:09
【问题描述】:

我的package.json 和index.js 有两个不同的名称,我无法在这两个地方更改。我收到此错误。

ember-cli: Your names in package.json and index.js should match. The addon in /Users/nrehman/Projects/copilot-seo-score currently have '@copilot/copilot-seo-score' in package.json and 'copilot-seo-score' in index.js. Until ember-cli v3.9, this error can be disabled by setting env variable EMBER_CLI_IGNORE_ADDON_NAME_MISMATCH to "true". For more information about this workaround, see: https://github.com/ember-cli/ember-cli/pull/7950.

我的 ember-cli 版本是"ember-cli": "~3.28.3"

【问题讨论】:

    标签: javascript ember.js


    【解决方案1】:

    我通常在我的插件中这样做:

    module.exports = {
      name: require('./package').name,
    }
    

    这样,即使重命名,它们也始终匹配。

    问题是您的 package.json 名称是 @copilot/copilot-seo-score,但您在 index.js 中的名称是 copilot-seo-score,它们需要匹配。

    【讨论】:

      猜你喜欢
      • 2021-08-19
      • 2022-10-07
      • 1970-01-01
      • 2013-01-29
      • 1970-01-01
      • 1970-01-01
      • 2015-04-29
      • 2018-11-09
      • 2018-03-22
      相关资源
      最近更新 更多