Angular 4项目无法运行

时间:2017-10-19 07:34:04

标签: angular

我已将项目从角度2更新为角度4。

我的项目没有使用角度cli。

更新后,我运行命令dotnet发布,一切似乎都很好

然后我想测试一下,是否运行成功,我确实运行了命令dotnet run。

最后,我在控制台中成了这条消息:

Uncaught reflect-metadata shim is required when using class decorators

我试图从不同的方式找到解决方案,但没有成功。

我的package.json看起来像这样:

"dependencies": {
"@angular/animations": "^4.4.5",
"@angular/common": "^4.4.5",
"@angular/compiler": "^4.4.5",
"@angular/core": "^4.4.5",
"@angular/forms": "^4.4.5",
"@angular/http": "^4.4.5",
"@angular/platform-browser": "^4.4.5",
"@angular/platform-browser-dynamic": "^4.4.5",
"@angular/platform-server": "^4.4.5",
"@angular/router": "^4.4.5",
"@ngx-translate/core": "^8.0.0",
"@ngx-translate/http-loader": "2.0.0",
"@types/node": "^8.0.34",
"angular-router-loader": "^0.6.0",
"angular2-image-upload": "^1.0.0-rc.0",
"angular2-template-loader": "^0.6.2",
"applicationinsights-js": "^1.0.8",
"aspnet-prerendering": "^3.0.1",
"aspnet-webpack": "^2.0.1",
"awesome-typescript-loader": "^3.0.0",
"bootstrap": "4.0.0-alpha.6",
"css": "^2.2.1",
"css-loader": "^0.28.0",
"es6-promise": "^4.1.0",
"es6-shim": "^0.35.1",
"event-source-polyfill": "^0.0.11",
"expose-loader": "^0.7.1",
"extract-text-webpack-plugin": "^3.0.1",
"file-loader": "^1.1.5",
"html-loader": "^0.5.1",
"isomorphic-fetch": "^2.2.1",
"jquery": "^3.2.1",
"js-beautify": "1.7.4",
"json-loader": "^0.5.4",
"mydatepicker": "2.0.32",
"mydaterangepicker": "^4.1.11",
"ng2-nouislider": "^1.6.0",
"ng2-validation": "^4.2.0",
"ngx-bootstrap": "^1.6.6",
"node-sass": "^4.5.2",
"nouislider": "^10.1.0",
"preboot": "^5.1.4",
"raw-loader": "^0.5.1",
"rxjs": "^5.0.1",
"sass-loader": "^6.0.3",
"style-loader": "^0.19.0",
"tether": "^1.4.0",
"to-string-loader": "^1.1.5",
"typescript": "^2.3.4",
"url-loader": "^0.6.2",
"webpack": "^3.7.1",
"webpack-hot-middleware": "^2.12.2",
"webpack-merge": "^4.1.0",
"zone.js": "^0.8.18"

},

和tsconfig.json就像这样:

    {
  "compilerOptions": {
    "baseUrl": "./",
    "moduleResolution": "node",
    "target": "es5",
    "sourceMap": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "skipDefaultLibCheck": true,
    "lib": [ "es6", "dom" ],
    "types": [ "node" ],
    "paths": {
        "CoreModules": ["./ClientApp/src/modules/core"],
        "FeatureModules": ["./ClientApp/src/modules/feature"],
        "SharedModules": ["./ClientApp/src/modules/shared"],      
        "CoreModule": ["./ClientApp/src/modules/core/core-app"],
        "xxxModule": ["./ClientApp/src/modules/feature/xxx"],
        "xxxxaModule": ["./ClientApp/src/modules/feature/xxx"],
        "xxxxModule": ["./ClientApp/src/modules/feature/xxx"],
        "DropdownModule": ["./ClientApp/src/modules/shared/dropdown"],
        "DialogModule": ["./ClientApp/src/modules/shared/dialog"],
        "UtilModule": ["./ClientApp/src/modules/shared/util"],
        "Resources": ["./ClientApp/src/resources"],
        "Styles": ["./ClientApp/src/styles"]
    }    
  },
  "include": [
    "./ClientApp/src/**/*"
  ],
  "exclude": [ "bin", "node_modules" ],
  "atom": { "rewriteTsconfig": false }

    }
谁能帮助我吗?

最诚挚的问候,

莱昂

0 个答案:

没有答案