Angular 角度8抛出错误`没有导出成员'ɵ;BrowserPlatformLocation'`
我在编译我的angular as时出错:Angular 角度8抛出错误`没有导出成员'ɵ;BrowserPlatformLocation'`,angular,typescript-typings,single-spa,Angular,Typescript Typings,Single Spa,我在编译我的angular as时出错: ERROR in node_modules/single-spa-angular/src/extra-providers.d.ts:2:10 - error TS2305: Module '"D:/trails/spa-angular-shared/login/node_modules/@angular/common/common"' has no exported member 'ɵBrowserPlatformLocation'.
ERROR in node_modules/single-spa-angular/src/extra-providers.d.ts:2:10 - error TS2305: Module '"D:/trails/spa-angular-shared/login/node_modules/@angular/common/common"' has no exported member 'ɵBrowserPlatformLocation'.
2 import { ɵBrowserPlatformLocation, LocationChangeEvent } from '@angular/common';
~~~~~~~~~~~~~~~~~~~~~~~~
package.json:
{
"name": "login",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"build:single-spa:login": "ng build login --prod --deploy-url http://localhost:4203/",
"serve:single-spa:login": "ng s --project login --disable-host-check --port 4203 --deploy-url http://localhost:4203/ --live-reload false"
},
"private": true,
"dependencies": {
"@angular/animations": "~8.2.0",
"@angular/compiler": "~8.2.0",
"@angular/core": "~8.2.0",
"@angular/forms": "~8.2.0",
"@angular/platform-browser": "~8.2.0",
"@angular/platform-browser-dynamic": "~8.2.0",
"@angular/router": "~8.2.0",
"@angular/common": "~8.2.0",
"rxjs": "~6.4.0",
"single-spa": ">=5.4.0",
"single-spa-angular": "^3.1.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-builders/custom-webpack": "^8",
"@angular-devkit/build-angular": "~0.803.10",
"@angular/cli": "~8.2.0",
"@angular/compiler-cli": "~8.2.0",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~5.18.0",
"typescript": "~3.5.3"
}
}
问题在于V3.5.3中修复的单个spa角度示意图。即使在v3.5.3中修复了if之前指定了版本,它也会安装最新版本 遵循以下步骤
angular common没有该类,它有PlatformLocation而不是ɵBrowserPlatformLocation您使用的是哪个版本的单spa angular?@AakashGarg-我使用的是“单spa angular”:“^3.1.0”,这可能会有帮助:-是的,工作正常。但是当我导入时,我得到的错误是:`UncaughtTypeError:Object prototype可能只是一个对象,或者null:undefined at setPrototypeOf()在extendStatics(tslib.es6.js:21)在u extenss(tslib.es6.js:25)在extra providers.ts:14在Object。(extra providers.ts:14)在Object.execute(amd.js:56)在Object.declaration.execute(名为exports.js:42)在doExec(system.js:478)在postOrderExec(system.js:474)在system.js:457`