无法在 Meteor 中使用 Accounts Package 删除电子邮件 [英] Cannot remove email using Accounts Package in Meteor

查看:24
本文介绍了无法在 Meteor 中使用 Accounts Package 删除电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在服务器端使用下面列出的基本帐户方法之一时,我总是收到以下类型的错误:

When trying to use one of the basic Accounts methods listed below on the server-side, I always get an error of the following type:

TypeError: Object # 没有方法 'removeEmail'

TypeError: Object # has no method 'removeEmail'

服务器方法:

  • Accounts.addEmail()
  • Accounts.removeEmail()
  • Accounts.findUserByUsername()
  • Accounts.findUserByEmail()

我已经从应用程序内部和 REPL shell 中进行了尝试.

I have tried from inside the app and from the REPL shell.

我使用的与帐户相关的软件包:

  • 流星平台
  • 帐户密码
  • 帐户-facebook
  • pauli:accounts-linkedin
  • 帐户-推特
  • splendido:accounts-emails-field
  • 帐户基础
  • 艾伦宁:角色

推荐答案

您可能运行的是 Meteor 1.2 之前的 Meteor 版本.我认为您提到的所有功能都是在 1.2 中添加的.要检查您的流星版本,请运行:

You are probably running a Meteor version prior to Meteor 1.2. I think all of the functions you mention were added in 1.2. To check your meteor version, run:

meteor --version

如果这不是问题,请提供导致您提到的错误的确切代码.

If that isn't the problem, please provide the exact code that is causing the error you mentioned.

仅供参考,以下显示这些方法存在于我的 Meteor 1.2 安装中,其中包含您提到的软件包:

FYI, the following shows that those methods exist in my Meteor 1.2 installation with the packages you mentioned:

[brettle@localhost test-app]$ meteor --version
Meteor 1.2.0.2
[brettle@localhost tmp]$ meteor create test-app
Created a new Meteor app in 'test-app'.       

To run your new app:                          
  cd test-app                                 
  meteor                                      

If you are new to Meteor, try some of the learning resources here:
  https://www.meteor.com/learn                

[brettle@localhost tmp]$ cd test-app

#### Note "meteor add accounts-password" also works instead of this next line: 

[brettle@localhost test-app]$ meteor add accounts-password accounts-facebook pauli:accounts-linkedin accounts-twitter splendido:accounts-emails-field accounts-base alanning:roles

Changes to your project's package version selections:

accounts-base                    added, version 1.2.1
accounts-facebook                added, version 1.0.6
accounts-oauth                   added, version 1.1.7
accounts-password                added, version 1.1.3
accounts-twitter                 added, version 1.0.6
alanning:roles                   added, version 1.2.14
ddp-rate-limiter                 added, version 1.0.0
email                            added, version 1.0.7
facebook                         added, version 1.2.2
localstorage                     added, version 1.0.5
npm-bcrypt                       added, version 0.7.8_2
oauth                            added, version 1.1.6
oauth1                           added, version 1.1.5
oauth2                           added, version 1.1.5
pauli:accounts-linkedin          added, version 1.1.2
pauli:linkedin                   added, version 1.1.2
rate-limit                       added, version 1.0.0
service-configuration            added, version 1.0.5
sha                              added, version 1.0.4
splendido:accounts-emails-field  added, version 1.2.0
srp                              added, version 1.0.4
twitter                          added, version 1.1.5


accounts-password: Password support for accounts
accounts-facebook: Login service for Facebook accounts
pauli:accounts-linkedin: Accounts service for LinkedIn accounts
accounts-twitter: Login service for Twitter accounts
splendido:accounts-emails-field: Adds to the user obj a `registered_emails`
field containing 3rd-party account service emails.
accounts-base: A user account system          
alanning:roles: Authorization package for Meteor
[brettle@localhost test-app]$ meteor &        
[1] 21185
[[[[[ ~/tmp/test-app ]]]]]                    

=> Started proxy.                             
=> Started MongoDB.                           
=> Started your app.                          

=> App running at: http://localhost:3000/
I20151007-23:49:34.554(-7)? ** You've set up some data subscriptions with Meteor.publish(), but
I20151007-23:49:34.555(-7)? ** you still have autopublish turned on. Because autopublish is still
I20151007-23:49:34.555(-7)? ** on, your Meteor.publish() calls won't have much effect. All data
I20151007-23:49:34.555(-7)? ** will still be sent to all clients.
I20151007-23:49:34.555(-7)? **
I20151007-23:49:34.556(-7)? ** Turn off autopublish by removing the autopublish package:
I20151007-23:49:34.556(-7)? **
I20151007-23:49:34.556(-7)? **   $ meteor remove autopublish
I20151007-23:49:34.556(-7)? **
I20151007-23:49:34.556(-7)? ** .. and make sure you have Meteor.publish() and Meteor.subscribe() calls
I20151007-23:49:34.556(-7)? ** for each collection that you want clients to see.
I20151007-23:49:34.556(-7)? 

[brettle@localhost test-app]$ meteor shell

Welcome to the server-side interactive shell!

Tab completion is enabled for global variables.

Type .reload to restart the server and the shell.
Type .exit to disconnect from the server and leave the shell.
Type .help for additional help.

> Accounts.removeEmail
[Function]
> Accounts.addEmail
[Function]
> Accounts.findUserByUsername
[Function]
> Accounts.findUserByEmail
[Function]

这篇关于无法在 Meteor 中使用 Accounts Package 删除电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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