NPM 回购丢失文件

NPM repo missing file

我有一个 git 一个 Ember 插件的回购协议:

https://github.com/lifegadget/ui-responsive-toolbelt

它通过了所有单元测试。它已作为 ui-responsive-toolbelt 发布到 npm。我已经使用 npm 的 "link" 功能在本地测试这个 "addon"(用 Ember 的说法)在包含在package.json 文件作为依赖项。

令人惊讶的是,当 npm 将此依赖项安装到 Ember 项目目录时,它带来了绝大多数文件,而没有抱怨。从 NPM 的角度来看,它似乎是一个干净的安装。不幸的是,插件在很大程度上依赖于它的 "entry point" ,它是 repo 根目录中的 index.js 。我已经非常清楚地将此文件包含在回购协议中,但由于某种原因,它没有被使用!

我已经在两台计算机和三个 Ember 项目上尝试过,结果都相同。请帮忙!


当我尝试使用 ember serve 启动服务器时,我从 Ember-CLI 得到的错误消息是:

The package ui-responsive-toolbelt is not a properly formatted package, we have used a fallback lookup to resolve it at /path/to/project/node_modules/ui-responsive-toolbelt. This is generally caused by an addon not having a main entry point (or index.js).

此消息重复两次,然后我得到:

The ui-responsive-toolbelt addon could not be found at /path/to/project/node_modules/ui-list/node_modules/ui-responsive-toolbelt.

  1. 我确认你的回购看起来很好
  2. npm install ui-responsive-toolbelt不下载索引文件

所以问题是npm publish没有正常工作。为此有一个错误。 https://github.com/npm/npm/issues/5082

你可以做的是使用最新的 npm 版本(或使用旧版本)再次发布你的插件,直到你看到索引文件也被添加。