2017-07-13 58 views
1

问题错误多的WebPack-DEV-服务器/客户端的http://本地主机:4200

  • 我跑的时候我跑
    1. NPM启动 或
    2. 纳克服务的角度CLI问题。

错误:webpack:无法编译。

纳克版本

@angular/cli: 1.1.0 
node: 6.11.0 
os: win32 x64 
@angular/animations: 4.2.6 
@angular/common: 4.2.6 
@angular/compiler: 4.2.6 
@angular/core: 4.2.6 
@angular/forms: 4.2.6 
@angular/http: 4.2.6 
@angular/platform-browser: 4.2.6 
@angular/platform-browser-dynamic: 4.2.6 
@angular/router: 4.2.6 
@angular/cli: 1.1.0 
@angular/compiler-cli: 4.2.6 
@angular/language-service: 4.2.6 

节点版本v6.11.0

D:\Angular2DevApp>npm version 
{ 'angular2-dev-app': '0.0.0', 
    npm: '5.2.0', 
    ares: '1.10.1-DEV', 
    http_parser: '2.7.0', 
    icu: '58.2', 
    modules: '48', 
    node: '6.11.0', 
    openssl: '1.0.2k', 
    uv: '1.11.0', 
    v8: '5.1.281.102', 
    zlib: '1.2.11' } 
  • 我已经安装了新的应用程序一起工作。

  • 任何建议是最受欢迎的。

错误形象:enter image description here

  • 当我试图NPM第二图像开始 enter image description here

回答

0

试试这个: 在你的WebPack配置,添加以下插件和装载机:

import {AotPlugin} from '@ngtools/webpack' 

exports = { /* ... */ 
    module: { 
    rules: [ 
     { 
     test: /\.ts$/, 
     loader: '@ngtools/webpack', 
     } 
    ] 
    }, 

    plugins: [ 
    new AotPlugin({ 
     tsConfigPath: 'path/to/tsconfig.json', 
     entryModule: 'path/to/app.module#AppModule' 
    }) 
    ] 
} 

加载程序与webpack插件一起编译您的TypeScript。包含两者都很重要,并且不要包含任何其他TypeScript编译器加载器。

-1

From a GitHub issue:首先,我卸载旧版本的CLI的全球范围内,清除缓存,然后全球的装机新版本CLI,以下说明:

npm uninstall -g angular-cli @angular/cli 
npm cache clean 
npm install -g @angular/[email protected] 

然后我更新的应用程序。

相关问题