2017-10-24 3 views
0

Imap Client를 Angular 4로 구현하려고합니다. 내 앱에서 Imap이 필요합니다.Angular 4 imap 클라이언트 빌딩, Semver 에러

나는 NPM과 IMAP를 구현하는 노드 모듈을 발견했습니다 Repo

을하지만 난 문제가 생겼어요. 나는

"scripts": [ 
    ..., 
    "../node_modules/imap/lib/Connection.js" 
    ], 

다음 각-cli.json에 다음 줄을 추가 내 MailboxModule에 가져

import { NgModule } from '@angular/core'; 
import { CommonModule } from '@angular/common'; 
import { MailboxComponent } from './mailbox.component'; 
import * as Imap from 'imap' ; 

@NgModule({ 
    imports: [ 
    CommonModule, 
    Imap 
    ], 
    providers : [ ], 
    declarations: [MailboxComponent] 
}) 
export class MailboxModule { } 

코드는 잘 컴파일하지만 난 내 웹 브라우저의 콘솔에서 다음과 같은 오류와 끝까지 :

를 여기
Uncaught TypeError: Invalid Version: 
    at new SemVer (semver.js:293) 
    at compare (semver.js:566) 
    at Function.gte (semver.js:615) 
    at Object.<anonymous> (utf7.js:4) 
    at Object.../../../../utf7/utf7.js (utf7.js:119) 
    at __webpack_require__ (bootstrap 55f9ac3…:54) 
    at Object.<anonymous> (Connection.js:7) 
    at Object.../../../../imap/lib/Connection.js (Connection.js:2128) 
    at __webpack_require__ (bootstrap 55f9ac3…:54) 
    at Object.../../../../../src/app/mailbox/mailbox.module.ts (mailbox.component.ts:11) 

가 (기본)

import { Component, OnInit } from '@angular/core'; 


@Component({ 
    selector: 'app-mailbox', 
    templateUrl: './mailbox.component.html', 
    styleUrls: ['./mailbox.component.css'] 
}) 
export class MailboxComponent implements OnInit { 
    constructor() { } 

    ngOnInit() { 

    } 
} 
,369이다 MailboxComponent

답변

0

webBrowsers는 TCP 소켓을 열 수 없으므로 웹 클라이언트에서 직접 전자 메일 클라이언트를 가져올 수 없습니다. IMAP 또는 다른 메일 프로토콜을 사용하여 메일 서버에 연결하는 백엔드가 필요하며 웹 응용 프로그램에서 호출 할 API를 통해 메일을 반환합니다.