CoffeeScript:ImapConnection未在node-imap中定义 [英] CoffeeScript: ImapConnection is not defined in node-imap

查看:146
本文介绍了CoffeeScript:ImapConnection未在node-imap中定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从以下网址运行示例咖啡脚本: CoffeScript和node-imap

I am trying to run example Coffee Scripts from: CoffeScript and node-imap

发送邮件可以正常工作,但是当我尝试阅读邮件时,我遇到了这种错误:

Sending messages works fine, but when I attempt to read a message, I got this kind of error:

TypeError: imap.ImapConnection is not a function
  at Object.<anonymous> (/home/rmatuszak/Dokumenty/NodeJS/mail/coffee2/read.coffee:15:14)
  at Object.<anonymous> (/home/rmatuszak/Dokumenty/NodeJS/mail/coffee2/read.coffee:7:1)
  at Module._compile (module.js:409:26)
  at Object.exports.run (/usr/lib/node_modules/coffee-script/lib/coffee-script/coffee-script.js:134:23)
  at compileScript (/usr/lib/node_modules/coffee-script/lib/coffee-script/command.js:224:29)
  at compilePath (/usr/lib/node_modules/coffee-script/lib/coffee-script/command.js:174:14)
  at Object.exports.run (/usr/lib/node_modules/coffee-script/lib/coffee-script/command.js:98:20)
  at Object.<anonymous> (/usr/lib/node_modules/coffee-script/bin/coffee:7:41)
  at Module._compile (module.js:409:26)
  at Object.Module._extensions..js (module.js:416:10)
  at Module.load (module.js:343:32)
  at Function.Module._load (module.js:300:12)
  at Function.Module.runMain (module.js:441:10)
  at startup (node.js:139:18)
  at node.js:968:3

在这个gist的主页上有人提到这个问题,但没有得到答案。 我已经得到了;)根据

On the homepage of this gist someone mentioned about this issue, but didn't get answer. Did anyone had issue like that?

推荐答案

com / mscdex / node-imaprel =nofollow>这个链接,我意识到,我必须创建一个新的imap对象使用 server = new imap 因为它是在脚本的开始时宣布的。

I got it ;) according to this link, I realized, that I have to create a new imap object using server = new imap as it was declared in the beggining of script.

这篇关于CoffeeScript:ImapConnection未在node-imap中定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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