在 Meteor Angular 1.3 中使用 npm 模块

Using npm modules in Meteor Angular 1.3

这似乎是一个愚蠢的问题,但我仍然感到困惑。据说 meteor 在 1.3 中内置了对 npm 模块的支持。

我正在使用集成了 Angular 的 Meteor。在教程中,使用 npm 模块似乎应该像这样简单:

  1. 正在将 npm 包安装到 meteor 根文件夹中

  1. import name from 'name'.
  2. 的形式将它们导入到文件中

但这似乎对我不起作用。

之所以能想到:

does not seem to be working for me

可能是因为并非所有包都像 MasterAM 提到的那样生成默认导出。

对于不支持默认导出的包,您可以使用: import 'name' 全局加载您的模块。