ng build没有成功执行我的角度应用程序

时间:2017-10-17 16:53:55

标签: javascript node.js angular angular2-routing angular-cli

  • 我正在尝试学习js和angular
  • 我安装了角度cli。
  • 之后我运行了build --prod。
  • 但我仍然低于错误。 无法读取属性' config'为null
  • 我搜索了该错误,但不确定如何修复它
  • 在下面提供错误和代码。
  • 我为angular ..安装了适当的版本。
  • 提供以下

    jkaksjkjsakj webcomponent / src / main / webapp(r1-rts)

    $ npm install @ angular / core @ 2.3.1 --save         sports@1.0.0 C:\ isdiuui \ webcomponent \ src \ main \ webapp         + - @ angular / core @ 2.3.1         + - UNMET PEER DEPENDENCY rxjs@5.0.0-beta.12         ` - UNMET PEER DEPENDENCY zone.js@0.6.25

    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\watchpack\node_modules\chokidar\node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
    npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
    npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
    npm WARN @angular/compiler-cli@2.4.10 requires a peer of @angular/compiler@2.4.10 but none was installed.
    npm WARN @angular/compiler-cli@2.4.10 requires a peer of @angular/core@2.4.10 but none was installed.
    npm WARN @angular/core@2.3.1 requires a peer of rxjs@5.0.0-rc.4 but none was installed.
    npm WARN @angular/core@2.3.1 requires a peer of zone.js@^0.7.2 but none was installed.
    npm WARN @angular/core@2.4.10 requires a peer of rxjs@^5.0.1 but none was installed.
    npm WARN license-webpack-plugin@1.1.0 requires a peer of webpack-sources@>= 1.0.0 but none was installed.
    npm WARN sports@1.0.0 No description
    npm WARN sports@1.0.0 No repository field.
    

ng构建错误

jkaksjkjsakj webcomponent/src/main/webapp (r1-rts)
$ ng build --prod
Cannot read property 'config' of null
TypeError: Cannot read property 'config' of null
    at Class.run (C:\isdiuui\webcomponent\src\main\webapp\node_modules\@angular\cli\tasks\build.js:15:56)
    at Class.run (C:\isdiuui\webcomponent\src\main\webapp\node_modules\@angular\cli\commands\build.js:204:26)
    at resolve (C:\isdiuui\webcomponent\src\main\webapp\node_modules\@angular\cli\ember-cli\lib\models\command.js:261:20)
    at Class.validateAndRun (C:\isdiuui\webcomponent\src\main\webapp\node_modules\@angular\cli\ember-cli\lib\models\command.js:240:12)
    at Promise.resolve.then.then (C:\isdiuui\webcomponent\src\main\webapp\node_modules\@angular\cli\ember-cli\lib\cli\cli.js:140:24)

ng version

jkaksjkjsakj webcomponent/src/main (r1-rts)
$ ng -v
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.4.7
node: 6.11.2
os: win32 x64

的package.json

{
  "name": "sports",
  "version": "1.0.0",
  "scripts": {
    "start": "tsc && concurrently \"npm run tsc:w\" \"npm run lite\" ",
    "lite": "lite-server",
    "postinstall": "typings install",
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "typings": "typings",
    "test": "tsc && concurrently \"karma start karma.conf.js\""
  },
  "license": "hhjjh",
  "dependencies": {
    "@angular/cli": "^1.4.7",
    "@angular/common": "2.0.0",
    "@angular/compiler": "2.0.0",
    "@angular/core": "^2.3.1",
    "@angular/forms": "2.0.0",
    "@angular/http": "2.0.0",
    "@angular/platform-browser": "2.0.0",
    "@angular/platform-browser-dynamic": "2.0.0",
    "@angular/router": "3.0.0",
    "@angular/upgrade": "2.0.0",
    "@types/underscore": "^1.8.1",
    "angular2-in-memory-web-api": "0.0.20",
    "bootstrap": "^3.3.6",
    "core-js": "^2.4.1",
    "jquery": "^3.1.1",
    "latest-version": "^2.0.0",
    "reflect-metadata": "^0.1.3",
    "rxjs": "5.0.0-beta.12",
    "systemjs": "0.19.27",
    "zone.js": "^0.6.23"
  },
  "devDependencies": {
    "concurrently": "^2.2.0",
    "lite-server": "^2.2.2",
    "typescript": "^2.0.2",
    "typings": "^1.3.2",
    "jasmine-core": "~2.4.1",
    "karma": "^1.2.0",
    "karma-chrome-launcher": "^0.2.3",
    "karma-cli": "^0.1.2",
    "karma-htmlfile-reporter": "^0.2.2",
    "karma-jasmine": "^0.3.8",
    "jasmine-expect": "^3.0.1",
    "jasmine-jquery": "^2.1.1",
    "karma-coverage": "^1.1.1",
    "karma-jquery": "^0.1.0",
    "karma-sourcemap-loader": "^0.3.7",
    "karma-typescript": "^2.1.4",
    "karma-typescript-preprocessor": "^0.3.0"
  }
}

0 个答案:

没有答案