我想以我的角度表示敬酒通知。我正在使用visual .net核心2.1模板.
运行本地主机时无法获取/出错.
运行ng生成后显示的错误..。
../../../../../node_modules/ng2-toasty/index.d.ts(1,37):错误TS2307:找不到模块‘@角/核心’。../../../../../node_modules/ng2-toasty/src/shared.d.ts(1,30):error TS2307:无法找到模块@ Cannot /platform-browser。../../../../../node_modules/ng2-toasty/src/shared.d.ts(2,31):错误TS2307:找不到模块‘@角/核心’。../../../../../node_modules/ng2-toasty/src/toast.component.d.ts(1,30):错误TS2307:找不到模块‘@角/核心’。../../../../../node_modules/ng2-toasty/src/toasty.component.d.ts(1,24):错误TS2307:找不到模块‘@角/核心’。../../../../../node_modules/ng2-toasty/src/toasty.service.d.ts(1,28):error TS2307:无法找到模块‘rxjs/可观察’。
AppModule:
import { VehicleFormComponent } from './vehicle-form/vehicle-form.component';
import { VehicleService } from './services/vehicle.service';
import { ToastyModule } from 'ng2-toasty';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpClientModule } from '@angular/common/http';
import { RouterModule } from '@angular/router';
@NgModule({
declarations: [
AppComponent,
NavMenuComponent,
HomeComponent,
VehicleFormComponent
],
imports: [
BrowserModule.withServerTransition({
appId: 'ng-cli-universal'
}),
FormsModule,
HttpClientModule,
FormsModule,
ToastyModule.forRoot(),
RouterModule.forRoot([
{
path: '',
component: HomeComponent,
pathMatch: 'full'
},
{
path: 'vehicles/new',
component: VehicleFormComponent
}
])
],
providers: [VehicleService],
bootstrap: [AppComponent]
})
export class AppModule {}发布于 2019-07-30 09:25:37
这主要是由于在构建角度应用程序时出现了任何类型的编译错误。确保npm控制台是干净的。为此,只需从npm控制台运行命令VSCode npm 即可。
发布于 2019-11-08 15:00:21
这基本上是你的角度应用程序中的一个错误。您可以检查Visual中的"Output“窗口,该窗口显示准确的错误消息。

发布于 2018-10-12 01:10:34
我用ngx库解决了这个问题,您需要做的是将您的角度应用程序更新为最新版本(从ClienApp文件夹)。使用这个链接。
在你做了更新后,添加ngx-烤面包,就像他们在网站上解释的那样,你将能够运行应用程序。
或者,您只需使用此命令安装较旧版本的ngx烤面包,它就能工作了。
npm install ngx-toastr@8.10.2 --savehttps://stackoverflow.com/questions/52119982
复制相似问题