Meteor - 添加自动成型包后出错 [英] Meteor - errors after adding autoform package

查看:54
本文介绍了Meteor - 添加自动成型包后出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将自动成型包添加到我的流星项目中.运行meteor add aldeed:autoform"并添加包后 - 我遇到以下错误:找不到模块mongo-object",无法读取未定义的属性AutoForm",未捕获的 ReferenceError:meteorInstall 未定义

我什至没有尝试使用该软件包.只是添加包导致了错误.我正在使用 Meteor 1.4.4.1

知道为什么会这样吗?我按照 autoform github repo 中的说明进行操作.

解决方案

autoform 6 的安装 说明如下:

$meteor add aldeed:autoform$ npm i --save 简单模式

然后您需要(在 v. >=6.0.0 中)在 SimpleSchema 定义中启用 autoform 条目的使用.这仅需要一次,例如在您的启动脚本中:

从'simpl-schema'导入SimpleSchema;SimpleSchema.extendOptions(['autoform']);

对于大多数人来说不是 100% 清楚的,切换到 af6

  1. 您需要从流星包中删除旧的 aldeed:simple-schema 包
  2. 您需要从已弃用的 collection2 切换到 collection2-core
  3. 您需要了解更改日志,表示已弃用的方法和方法名称更改.

如果您关心所有这些更改,它应该可以再次正常运行.

2018 年 3 月更新:collection2-core 现在已合并回 aldeed:collection2,因此请使用此软件包的最新版本.>

I am trying to add the autoform package to my meteor project. After running "meteor add aldeed:autoform" and adding the package - I am encountering the following errors: Cannot find module 'mongo-object', Cannot read property 'AutoForm' of undefined, Uncaught ReferenceError: meteorInstall is not defined

I didn't even try to use the package. Just adding the package caused the errors. I am using Meteor 1.4.4.1

Any idea why this happens ? I followed the instruction in the autoform github repo.

解决方案

The installation for autoform 6 says the following:

$ meteor add aldeed:autoform
$ npm i --save simpl-schema

Then you need (in v. >=6.0.0) to enable the use of autoform entries in SimpleSchema definitions. This is just required once, e.g. in your startup scripts:

import SimpleSchema from 'simpl-schema';
SimpleSchema.extendOptions(['autoform']);

What is not 100% clear to most people, switching to af6

  1. you need to remove the old aldeed:simple-schema package from the meteor packages
  2. you need to switch from the deprecated collection2 to collection2-core
  3. you need to be aware of the change log, which indicates deprecated method and method name changes.

If you concern all of these changes it should run really fine again.

Update March 2018: collection2-core is now merged back to aldeed:collection2 so use the latest version of this package.

这篇关于Meteor - 添加自动成型包后出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆