【问题标题】:aldeed:collection2 not working with iron clialdeed:collection2 不适用于 Iron cli
【发布时间】:2019-07-09 12:09:58
【问题描述】:

我是流星铁的新手,我正在尝试安装 aldeed collection2,但应用程序崩溃

W20190215-12:44:48.023(2)? (STDERR) WARNING: npm peer requirements (for aldeed:collection2) not installed:
W20190215-12:44:48.024(2)? (STDERR)  - simpl-schema@>=0.0.0 not installed.

我尝试安装简单模式,但没有任何效果。

meteor npm install simpl-schema --save

我还删除并重新安装了 collection2,但我仍然遇到同样的错误。我错过了什么?

【问题讨论】:

  • 请添加您的 Meteor 发布版本、package.json 和您的 .meteor/packages 内容,以便我尝试重现
  • meteor: 1.8.0.2 铁版: 1.8.1 package.json { "name": "wisdomapp", "version": "1.0.0", "description": "一个教书的应用智慧。", "main": "index.js", "scripts": { "test": "echo \"错误:没有指定测试\" && exit 1" }, "author": "King Zuru", "许可证”:“ISC”,“依赖项”:{“铁”:“^5.0.6”,“simpl-schema”:“^1.5.5”}}
  • .meteor/packages meteor-base@1.4.0 mobile-experience@1.0.5 mongo@1.6.0 reactive-var@1.0.11 tracker@1.2.0 standard-minifier-css@1.5 .2 standard-minifier-js@2.4.0 es5-shim@4.8.0 # ECMAScript 5 对旧浏览器的兼容性 ecmascript@0.12.4 # 在应用程序代码中启用 ECMAScript2015+ 语法 shell-server@0.4.0 # 服务器端组件meteor shell 命令 iron:router blaze-html-templates twbs:bootstrap aldeed:autoform aldeed:collection2-core@2.0.0

标签: meteor iron-router


【解决方案1】:

我尝试使用新创建的 repo 重现错误,其中包含您列出的依赖项,但在我这边一切运行良好。

但是,我发现 aldeed:collection2-core 现在有些被弃用并被合并回 aldeed:collection2,正如您可以在 project repository on GitHub 中看到的那样:

重要提示:此软件包已合并回 aldeed:collection2 作为该软件包的 3.0.0 版本。参考https://github.com/aldeed/meteor-collection2/blob/master/CHANGELOG.md#300

在其他 repo 中创建问题和 PR:https://github.com/aldeed/meteor-collection2/issues

问题在此 repo 上保持启用,仅供参考现有问题。

因此,好的第一步是删除已弃用的软件包并安装更新的软件包:

meteor remove aldeed:collection2-core
meteor add aldeed:collection2

如果您想从一个新的干净项目开始,您可以在此处重现这些步骤以达到运行起点:

meteor create someprojectname
cd someprojectname
meteor add iron:router twbs:bootstrap aldeed:autoform aldeed:collection2
meteor npm install --save iron simpl-schema
meteor

项目将无错误地启动。从这里你可以开始包含你以前的代码,看看错误是否会再次出现(这很可能是你的代码中的一个问题)。

关于twbs:bootstrap的重要说明:

twbs:bootstrap 使用old version (3.3.6),它被认为包含多个安全漏洞(阅读herehere)。

如果你想使用最新的 Bootstrap,你可以像这样使用 npm 安装 bootstrap:

meteor remove twbs:bootstrap
meteor npm install --save bootstrap@latest jquery@latest popper.js@latest

这里也需要jquery,因为 Meteor 不包含所需的版本,而popper.js 处理 Popover、Modal 等。

要将其包含在您的代码中,您需要将这些行添加到您的客户端代码中:

import 'bootstrap'
import popper from 'popper.js'
global.Popper = popper

要将 Bootstrap 4 与 AutoForm 一起使用,您可以安装 imajus:autoform-bootstrap4 (repo) 并将以下内容添加到您的客户端代码中:

AutoForm.setDefaultTemplate('bootstrap4')

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-03-06
    • 1970-01-01
    • 2016-06-21
    • 2014-06-09
    • 2014-10-26
    • 1970-01-01
    • 2011-09-09
    相关资源
    最近更新 更多