【发布时间】:2020-07-30 06:06:03
【问题描述】:
我只在 ASP.Net Core 上工作了几天,经过两天的不成功尝试,我的神经都紧张了。
我正在尝试从这里https://aspnetboilerplate.com/Templates 运行 ASP.Net Core 样板。我完全按照说明进行操作,但唯一的进展是错误消息已更改:
我的终端输出:
> surveydpo@4.7.1 start D:\Benutzer\Admin\Dokumente\Visual Studio 2019\SurveyDPO\5.4.0\angular
> ng serve --host 0.0.0.0 --port 4200
WARNING: This is a simple server for use in testing or debugging Angular applications
locally. It hasn't been reviewed for security issues.
Binding this server to an open connection can result in compromising your application or
computer. Using a different host than the one passed to the "--host" flag might result in
websocket connection issues. You might need to use "--disableHostCheck" if that's the
case.
10% building 3/3 modules 0 activei 「wds」: Project is running at http://0.0.0.0:4200/webpack-dev-server/
i 「wds」: webpack output is served from /
i 「wds」: 404s will fallback to //index.html
chunk {main} main.js, main.js.map (main) 2.07 kB [initial] [rendered]
chunk {polyfills} polyfills.js, polyfills.js.map (polyfills) 154 kB [initial] [rendered]
chunk {runtime} runtime.js, runtime.js.map (runtime) 6.15 kB [entry] [rendered]
chunk {scripts} scripts.js, scripts.js.map (scripts) 1.15 MB [entry] [rendered]
chunk {styles} styles.js, styles.js.map (styles) 2.18 MB [initial] [rendered]
chunk {vendor} vendor.js, vendor.js.map (vendor) 340 kB [initial] [rendered]
Date: 2020-04-16T19:48:33.963Z - Hash: 1f1c667e422cd368a343 - Time: 17020ms
ERROR in ../node_modules/ngx-bootstrap/datepicker/bs-datepicker.component.d.ts:3:10 - error TS2305: Module '"D:/Benutzer/Admin/Dokumente/Visual Studio 2019/SurveyDPO/5.4.0/angular/node_modules/rxjs/Subscription"' has no exported member 'Subscription'.
3 import { Subscription } from 'rxjs/Subscription';
~~~~~~~~~~~~
../node_modules/ngx-bootstrap/datepicker/bs-daterangepicker.component.d.ts:3:10 - error TS2305: Module '"D:/Benutzer/Admin/Dokumente/Visual Studio 2019/SurveyDPO/5.4.0/angular/node_modules/rxjs/Subscription"' has no exported member 'Subscription'.
3 import { Subscription } from 'rxjs/Subscription';
~~~~~~~~~~~~
../node_modules/ngx-bootstrap/datepicker/bs-locale.service.d.ts:1:10 - error TS2305: Module '"D:/Benutzer/Admin/Dokumente/Visual Studio 2019/SurveyDPO/5.4.0/angular/node_modules/rxjs/Observable"' has no exported member 'Observable'.
1 import { Observable } from 'rxjs/Observable';
~~~~~~~~~~
../node_modules/ngx-bootstrap/datepicker/bs-locale.service.d.ts:2:10 - error TS2305: Module '"D:/Benutzer/Admin/Dokumente/Visual Studio 2019/SurveyDPO/5.4.0/angular/node_modules/rxjs/BehaviorSubject"' has no exported member 'BehaviorSubject'.
2 import { BehaviorSubject } from 'rxjs/BehaviorSubject';
~~~~~~~~~~~~~~~
../node_modules/ngx-bootstrap/mini-ngrx/state.class.d.ts:4:10 - error TS2305: Module '"D:/Benutzer/Admin/Dokumente/Visual Studio 2019/SurveyDPO/5.4.0/angular/node_modules/rxjs/BehaviorSubject"' has no exported member 'BehaviorSubject'.
4 import { BehaviorSubject } from 'rxjs/BehaviorSubject';
~~~~~~~~~~~~~~~
../node_modules/ngx-bootstrap/mini-ngrx/state.class.d.ts:5:10 - error TS2305: Module '"D:/Benutzer/Admin/Dokumente/Visual Studio 2019/SurveyDPO/5.4.0/angular/node_modules/rxjs/Observable"' has no exported member 'Observable'.
5 import { Observable } from 'rxjs/Observable';
~~~~~~~~~~
../node_modules/ngx-bootstrap/mini-ngrx/store.class.d.ts:4:10 - error TS2305: Module '"D:/Benutzer/Admin/Dokumente/Visual Studio 2019/SurveyDPO/5.4.0/angular/node_modules/rxjs/Observable"' has no exported member 'Observable'.
4 import { Observable } from 'rxjs/Observable';
~~~~~~~~~~
../node_modules/ngx-bootstrap/mini-ngrx/store.class.d.ts:5:10 - error TS2305: Module '"D:/Benutzer/Admin/Dokumente/Visual Studio 2019/SurveyDPO/5.4.0/angular/node_modules/rxjs/Observer"' has no exported member 'Observer'.
5 import { Observer } from 'rxjs/Observer';
~~~~~~~~
../node_modules/ngx-bootstrap/mini-ngrx/store.class.d.ts:6:10 - error TS2305: Module '"D:/Benutzer/Admin/Dokumente/Visual Studio 2019/SurveyDPO/5.4.0/angular/node_modules/rxjs/Operator"' has no exported member 'Operator'.
6 import { Operator } from 'rxjs/Operator';
~~~~~~~~
../node_modules/ngx-bootstrap/sortable/draggable-item.service.d.ts:1:10 - error TS2305: Module '"D:/Benutzer/Admin/Dokumente/Visual Studio 2019/SurveyDPO/5.4.0/angular/node_modules/rxjs/Subject"' has no exported member 'Subject'.
1 import { Subject } from 'rxjs/Subject';
~~~~~~~
../node_modules/ngx-bootstrap/timepicker/timepicker.component.d.ts:7:10 - error TS2305: Module '"D:/Benutzer/Admin/Dokumente/Visual Studio 2019/SurveyDPO/5.4.0/angular/node_modules/rxjs/Subscription"' has no exported member 'Subscription'.
7 import { Subscription } from 'rxjs/Subscription';
~~~~~~~~~~~~
../node_modules/rxjs/BehaviorSubject.d.ts:1:15 - error TS2307: Cannot find module 'rxjs-compat/BehaviorSubject'.
1 export * from 'rxjs-compat/BehaviorSubject';
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/rxjs/Observable.d.ts:1:15 - error TS2307: Cannot find module 'rxjs-compat/Observable'.
1 export * from 'rxjs-compat/Observable';
~~~~~~~~~~~~~~~~~~~~~~~~
../node_modules/rxjs/Observer.d.ts:1:15 - error TS2307: Cannot find module 'rxjs-compat/Observer'.
1 export * from 'rxjs-compat/Observer';
~~~~~~~~~~~~~~~~~~~~~~
../node_modules/rxjs/Operator.d.ts:1:15 - error TS2307: Cannot find module 'rxjs-compat/Operator'.
1 export * from 'rxjs-compat/Operator';
~~~~~~~~~~~~~~~~~~~~~~
../node_modules/rxjs/Subject.d.ts:1:15 - error TS2307: Cannot find module 'rxjs-compat/Subject'.
1 export * from 'rxjs-compat/Subject';
~~~~~~~~~~~~~~~~~~~~~
../node_modules/rxjs/Subscription.d.ts:1:15 - error TS2307: Cannot find module 'rxjs-compat/Subscription'.
1 export * from 'rxjs-compat/Subscription';
~~~~~~~~~~~~~~~~~~~~~~~~~~
** Angular Live Development Server is listening on 0.0.0.0:4200, open your browser on http://localhost:4200/
**
i 「wdm」: Failed to compile.
package.json
{
"name": "surveydpo",
"version": "4.7.1",
"license": "MIT",
"angular-cli": {},
"scripts": {
"ng": "ng",
"start": "ng serve --host 0.0.0.0 --port 4200",
"hmr": "ng serve --host 0.0.0.0 --port 4200 --hmr",
"test": "ng test",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "protractor",
"lint": "tslint --force --project src/tsconfig.json src/**/*.ts -t verbose"
},
"private": true,
"dependencies": {
"@angular/animations": "^8.2.4",
"@angular/cdk": "^8.1.4",
"@angular/common": "^8.2.4",
"@angular/compiler": "^8.2.4",
"@angular/core": "^8.2.4",
"@angular/forms": "^8.2.4",
"@angular/material": "^8.1.4",
"@angular/platform-browser": "^8.2.4",
"@angular/platform-browser-dynamic": "^8.2.4",
"@angular/router": "^8.2.4",
"@aspnet/signalr": "^1.1.4",
"@types/bootstrap": "^3.3.33",
"@types/jquery": "^3.3.31",
"@types/jquery.blockui": "0.0.28",
"@types/jquery.validation": "^1.16.3",
"@types/lodash": "^4.14.62",
"@types/moment": "^2.13.0",
"@types/moment-timezone": "^0.5.12",
"@types/toastr": "^2.1.33",
"abp-ng2-module": "^5.1.1",
"abp-web-resources": "^5.1.1",
"animate.css": "^3.5.2",
"block-ui": "^2.70.1",
"bootstrap": "^3.3.7",
"bootstrap-select": "^1.12.2",
"chart.js": "^2.6.0",
"core-js": "^3.2.1",
"famfamfam-flags": "^1.0.0",
"flot": "^0.8.0-alpha",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"jquery": "^3.1.1",
"jquery-countto": "^1.2.0",
"jquery-migrate": "^3.0.0",
"jquery-slimscroll": "^1.3.8",
"jquery-sparkline": "^2.4.0",
"js-cookie": "^2.1.4",
"lodash": "^4.17.4",
"moment": "^2.18.1",
"moment-timezone": "^0.5.13",
"morris.js": "^0.5.0",
"ngx-bootstrap": "^2.0.5",
"ngx-pagination": "^4.1.0",
"node-waves": "^0.7.5",
"push.js": "1.0.9",
"raphael": "^2.2.7",
"rxjs": "^6.4.0",
"simple-line-icons": "^2.4.1",
"spin.js": "^2.3.2",
"sweetalert": "^2.0.8",
"toastr": "^2.1.2",
"ts-helpers": "^1.1.2",
"web-animations-js": "^2.3.2",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.803.2",
"@angular/cli": "^8.3.2",
"@angular/compiler-cli": "^8.2.4",
"@angularclass/hmr": "^2.1.3",
"@types/jasmine": "^3.4.0",
"@types/node": "^12.7.3",
"codelyzer": "^5.0.1",
"jasmine-core": "^3.3.0",
"jasmine-spec-reporter": "^4.2.1",
"karma": "^4.3.0",
"karma-chrome-launcher": "^3.1.0",
"karma-cli": "^2.0.0",
"karma-coverage-istanbul-reporter": "^2.0.4",
"karma-jasmine": "^2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"nswag": "^13.0.6",
"protractor": "^5.1.1",
"ts-node": "^8.3.0",
"tslint": "^5.19.0",
"typescript": "3.4.5",
"webpack-bundle-analyzer": "^3.0.3"
}
}
angular.json
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"surveydpo": {
"root": "",
"sourceRoot": "src",
"projectType": "application",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist",
"index": "src/index.html",
"main": "src/main.ts",
"tsConfig": "src/tsconfig.json",
"polyfills": "src/polyfills.ts",
"assets": [
"src/assets",
"src/favicon.ico",
{
"glob": "abp.signalr.js",
"input": "node_modules/abp-web-resources/Abp/Framework/scripts/libs",
"output": "/assets/abp"
},
{
"glob": "abp.signalr-client.js",
"input": "node_modules/abp-web-resources/Abp/Framework/scripts/libs",
"output": "/assets/abp"
}
],
"styles": [
"node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
"src/assets/fonts/roboto/roboto.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/simple-line-icons/css/simple-line-icons.css",
"node_modules/font-awesome/css/font-awesome.css",
"node_modules/famfamfam-flags/dist/sprite/famfamfam-flags.css",
"node_modules/toastr/build/toastr.css",
"node_modules/node-waves/dist/waves.css",
"src/bsb-theme/css/materialize.css",
"src/bsb-theme/css/style.css",
"src/bsb-theme/css/themes/all-themes.css",
"src/shared/core.less"
],
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/jquery-migrate/dist/jquery-migrate.min.js",
"node_modules/js-cookie/src/js.cookie.js",
"node_modules/bootstrap/dist/js/bootstrap.js",
"node_modules/lodash/lodash.min.js",
"node_modules/moment/min/moment.min.js",
"node_modules/@aspnet/signalr/dist/browser/signalr.min.js",
"node_modules/toastr/toastr.js",
"node_modules/sweetalert/dist/sweetalert.min.js",
"node_modules/block-ui/jquery.blockUI.js",
"node_modules/spin.js/spin.min.js",
"node_modules/spin.js/jquery.spin.js",
"node_modules/push.js/bin/push.min.js",
"node_modules/jquery-slimscroll/jquery.slimscroll.min.js",
"node_modules/node-waves/dist/waves.min.js",
"node_modules/jquery-countto/jquery.countTo.js",
"node_modules/raphael/raphael.min.js",
"node_modules/morris.js/morris.min.js",
"node_modules/chart.js/dist/Chart.bundle.min.js",
"node_modules/flot/jquery.flot.js",
"node_modules/flot/jquery.flot.resize.js",
"node_modules/flot/jquery.flot.pie.js",
"node_modules/flot/jquery.flot.categories.js",
"node_modules/flot/jquery.flot.time.js",
"node_modules/jquery-sparkline/jquery.sparkline.min.js",
"node_modules/abp-web-resources/Abp/Framework/scripts/abp.js",
"node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.jquery.js",
"node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.toastr.js",
"node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.blockUI.js",
"node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.spin.js",
"node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.sweet-alert.js",
"node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.moment.js",
"src/bsb-theme/js/admin.js",
"src/bsb-theme/js/demo.js",
"src/bsb-theme/js/jquery.validate.js"
]
},
"configurations": {
"production": {
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
]
},
"hmr": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.hmr.ts"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "surveydpo:build"
},
"configurations": {
"production": {
"browserTarget": "surveydpo:build:production"
},
"hmr": {
"browserTarget": "surveydpo:build:hmr"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "surveydpo:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"karmaConfig": "./karma.conf.js",
"polyfills": "src/polyfills.ts",
"scripts": [
"node_modules/jquery/dist/jquery.min.js",
"node_modules/jquery-migrate/dist/jquery-migrate.min.js",
"node_modules/js-cookie/src/js.cookie.js",
"node_modules/bootstrap/dist/js/bootstrap.js",
"node_modules/lodash/lodash.min.js",
"node_modules/moment/min/moment.min.js",
"node_modules/@aspnet/signalr/dist/browser/signalr.min.js",
"node_modules/toastr/toastr.js",
"node_modules/sweetalert/dist/sweetalert.min.js",
"node_modules/block-ui/jquery.blockUI.js",
"node_modules/spin.js/spin.min.js",
"node_modules/spin.js/jquery.spin.js",
"node_modules/push.js/bin/push.min.js",
"node_modules/jquery-slimscroll/jquery.slimscroll.min.js",
"node_modules/node-waves/dist/waves.min.js",
"node_modules/jquery-countto/jquery.countTo.js",
"node_modules/raphael/raphael.min.js",
"node_modules/morris.js/morris.min.js",
"node_modules/chart.js/dist/Chart.bundle.min.js",
"node_modules/flot/jquery.flot.js",
"node_modules/flot/jquery.flot.resize.js",
"node_modules/flot/jquery.flot.pie.js",
"node_modules/flot/jquery.flot.categories.js",
"node_modules/flot/jquery.flot.time.js",
"node_modules/jquery-sparkline/jquery.sparkline.min.js",
"node_modules/abp-web-resources/Abp/Framework/scripts/abp.js",
"node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.jquery.js",
"node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.toastr.js",
"node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.blockUI.js",
"node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.spin.js",
"node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.sweet-alert.js",
"node_modules/abp-web-resources/Abp/Framework/scripts/libs/abp.moment.js",
"src/bsb-theme/js/admin.js",
"src/bsb-theme/js/demo.js",
"src/bsb-theme/js/jquery.validate.js"
],
"styles": [
"src/assets/fonts/roboto/roboto.css",
"node_modules/bootstrap/dist/css/bootstrap.min.css",
"node_modules/simple-line-icons/css/simple-line-icons.css",
"node_modules/font-awesome/css/font-awesome.css",
"node_modules/famfamfam-flags/dist/sprite/famfamfam-flags.css",
"node_modules/toastr/build/toastr.css",
"node_modules/node-waves/dist/waves.css",
"src/bsb-theme/css/materialize.css",
"src/bsb-theme/css/style.css",
"src/bsb-theme/css/themes/all-themes.css",
"src/shared/core.less"
],
"assets": [
"src/assets",
"src/favicon.ico",
{
"glob": "abp.signalr.js",
"input": "node_modules/abp-web-resources/Abp/Framework/scripts/libs",
"output": "/assets/abp"
},
{
"glob": "abp.signalr-client.js",
"input": "node_modules/abp-web-resources/Abp/Framework/scripts/libs",
"output": "/assets/abp"
}
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.json"
],
"exclude": []
}
}
}
},
"surveydpo-e2e": {
"root": "",
"sourceRoot": "",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "./protractor.conf.js",
"devServerTarget": "surveydpo:serve"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"e2e/tsconfig.json"
],
"exclude": []
}
}
}
}
},
"defaultProject": "surveydpo",
"schematics": {
"@schematics/angular:component": {
"prefix": "app",
"styleext": "css"
},
"@schematics/angular:directive": {
"prefix": "app"
}
}
}
app.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { HttpClientJsonpModule } from '@angular/common/http';
import { HttpClientModule } from '@angular/common/http';
import { ModalModule } from 'ngx-bootstrap';
import { NgxPaginationModule } from 'ngx-pagination';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { AbpModule } from '@abp/abp.module';
import { ServiceProxyModule } from '@shared/service-proxies/service-proxy.module';
import { SharedModule } from '@shared/shared.module';
import { HomeComponent } from '@app/home/home.component';
import { AboutComponent } from '@app/about/about.component';
import { TopBarComponent } from '@app/layout/topbar.component';
import { TopBarLanguageSwitchComponent } from '@app/layout/topbar-languageswitch.component';
import { SideBarUserAreaComponent } from '@app/layout/sidebar-user-area.component';
import { SideBarNavComponent } from '@app/layout/sidebar-nav.component';
import { SideBarFooterComponent } from '@app/layout/sidebar-footer.component';
import { RightSideBarComponent } from '@app/layout/right-sidebar.component';
// tenants
import { TenantsComponent } from '@app/tenants/tenants.component';
import { CreateTenantDialogComponent } from './tenants/create-tenant/create-tenant-dialog.component';
import { EditTenantDialogComponent } from './tenants/edit-tenant/edit-tenant-dialog.component';
// roles
import { RolesComponent } from '@app/roles/roles.component';
import { CreateRoleDialogComponent } from './roles/create-role/create-role-dialog.component';
import { EditRoleDialogComponent } from './roles/edit-role/edit-role-dialog.component';
// users
import { UsersComponent } from '@app/users/users.component';
import { CreateUserDialogComponent } from '@app/users/create-user/create-user-dialog.component';
import { EditUserDialogComponent } from '@app/users/edit-user/edit-user-dialog.component';
import { ChangePasswordComponent } from './users/change-password/change-password.component';
import { ResetPasswordDialogComponent } from './users/reset-password/reset-password.component';
@NgModule({
declarations: [
AppComponent,
HomeComponent,
AboutComponent,
TopBarComponent,
TopBarLanguageSwitchComponent,
SideBarUserAreaComponent,
SideBarNavComponent,
SideBarFooterComponent,
RightSideBarComponent,
// tenants
TenantsComponent,
CreateTenantDialogComponent,
EditTenantDialogComponent,
// roles
RolesComponent,
CreateRoleDialogComponent,
EditRoleDialogComponent,
// users
UsersComponent,
CreateUserDialogComponent,
EditUserDialogComponent,
ChangePasswordComponent,
ResetPasswordDialogComponent
],
imports: [
CommonModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
HttpClientJsonpModule,
ModalModule.forRoot(),
AbpModule,
AppRoutingModule,
ServiceProxyModule,
SharedModule,
NgxPaginationModule
],
providers: [],
entryComponents: [
// tenants
CreateTenantDialogComponent,
EditTenantDialogComponent,
// roles
CreateRoleDialogComponent,
EditRoleDialogComponent,
// users
CreateUserDialogComponent,
EditUserDialogComponent,
ResetPasswordDialogComponent
]
})
export class AppModule {}
如果有人可以帮助我,我会很高兴,
【问题讨论】:
-
你可以尝试将 ngx-bootstrap 和 rxjs 包更新到最新版本
-
我尝试更新大部分模块,但出现如下错误:PS D:\Benutzer\........ 2019\SurveyDPO\5.4.0\angular> npm update ngx-bootstrap PS D:\Benutzer\Admin\Dokumente\Visual Studio 2019\SurveyDPO\5.4.0\angular> npm update rxjs PS D:\Benutzer\Admin\Dokumente\Visual Studio 2019\SurveyDPO\5.4.0\angular> npm install -g rxjs + rxjs@6.5.5 在 5.094s PS D:\Benutzer\Admin\Dokumente\Visual Studio 2019\SurveyDPO\5.4.0\angular> 添加了来自 7 个贡献者的 2 个包 npm install ngx-bootstrap npm ERR!无法读取未定义的属性“匹配”
标签: angular asp.net-core aspnetboilerplate npm-start