gpt4 book ai didi

angularjs - 多 webpack-dev-server/client 中出现错误?http ://localhost:4200

转载 作者:太空宇宙 更新时间:2023-11-03 22:26:45 25 4
gpt4 key购买 nike

问题

  • 我运行时遇到了 Angular cli 问题
    1. npm 启动或
    2. 发球。

错误:webpack:编译失败。

ng version

@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

node version 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 start 时的第二张图片 enter image description here

最佳答案

试试这个: 在您的 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 编译器加载程序很重要。

关于angularjs - 多 webpack-dev-server/client 中出现错误?http ://localhost:4200,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45074266/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com