0
我遇到了麻煩,最新的Angular 4和通用的,奇怪的行爲捆綁... 我正在使用Webpack的構建。我所有的配置看起來都像valids。我嘗試使用帶有空div和「hello world」文本的演示應用程序,但錯誤沒有消失。 IDK跆拳道是hapn ...Angular 4+通用:沒有導出成員'StaticProvider'
ERROR in [at-loader] ./node_modules/@nguniversal/express-
engine/src/main.d.ts:2:33
TS2305: Module '"webclient/node_modules/@angular/core/core"' has no exported member "StaticProvider"'
的package.json和Tsconfig列表如下:
"dependencies": {
"@angular/common": "~4.4.4",
"@angular/compiler": "~4.4.4",
"@angular/core": "~4.4.4",
"@angular/http": "~4.4.4",
"@angular/platform-browser": "~4.4.4",
"@angular/platform-browser-dynamic": "4.4.4",
"@angular/platform-server": "4.4.4",
"@angular/router": "4.4.4",
"@angular/animations": "4.4.4",
"@angular/cdk": "~2.0.0-beta.11",
"@angular/flex-layout": "~2.0.0-beta.9",
"@angular/forms": "~4.4.4",
"@angular/material": "~2.0.0-beta.11",
"@nguniversal/express-engine": "~5.0.0-beta.1",
"@nguniversal/module-map-ngfactory-loader": "~5.0.0-beta.1",
"@types/webpack": "^3.0.12",
"angulartics2": "~2.4.0",
"core-js": "~2.5.1",
"md2": "~0.0.28",
"moment": "~2.18.1",
"ng2-device-detector": "*",
"ng2-filter-pipe": "*",
"ng2-md-datatable": "~1.4.0",
"ng2-ui-auth": "~7.0.2",
"ngx-chips": "~1.5.3",
"ngx-cookie": "*",
"rxjs": "~5.4.3",
"ts-helpers": "~1.1.2",
"tslerp": "~1.0.5",
"web-animations-js": "~2.3.1",
"zone.js": "~0.8.18"
},
"devDependencies": {
"@angular/cli": "^1.4.4",
"@angular/compiler-cli": "~4.4.4",
"@ngtools/webpack": "~1.7.2",
"@types/jasmine": "~2.6.0",
"@types/node": "~8.0.31",
"angular2-template-loader": "~0.6.2",
"awesome-typescript-loader": "~3.2.3",
"codelyzer": "~3.2.0",
"cpy-cli": "~1.0.1",
"http-server": "~0.10.0",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-cli": "~1.0.1",
"karma-jasmine": "~1.1.0",
"karma-remap-istanbul": "~0.6.0",
"node-sass": "~4.5.3",
"protractor": "~5.1.2",
"reflect-metadata": "~0.1.10",
"ts-node": "~3.3.0",
"tslint": "~5.7.0",
"typescript": "^2.3.4"
}
}
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"moduleResolution": "node",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"noEmit": true,
"noEmitHelpers": true,
"importHelpers": true,
"strictNullChecks": false,
"outDir": "./dist/out-tsc",
"lib": [
"dom",
"es6"
],
"baseUrl": ".",
"paths": {
"@angular/*": ["node_modules/@angular/*"]
},
"typeRoots": [
"node_modules/@types"
],
"types": [
"moment",
"jasmine",
"node",
"source-map",
"uglify-js",
"webpack"
]
},
"exclude": [
"test.ts",
"**/*.spec.ts",
"node_modules/*",
"**/*.e2e-spec.ts",
"dist"
],
"awesomeTypescriptLoaderOptions": {
"forkChecker": true,
"useWebpackText": true
},
"compileOnSave": false,
"buildOnSave": false,
"atom": {
"rewriteTsconfig": false
}
}
粘貼代碼,請。 – Baruch