ng2-material在jspm bundle上失败

时间:2016-01-31 01:33:46

标签: bundle material-design angular angular-material jspm

经过很多时间,最后我只是将ng2-material与angular2集成在一起。 但是,当我使用以下命令捆绑我的应用程序时:

jspm bundle-sfx --minify --inject app/boot public/build/bundle.js

捆绑失败。 这个命令不起作用,因为我将下一个代码添加到我的proyect中:

从&ng-ng2-material / all'中导入{MATERIAL_DIRECTIVES};

完整代码:

import {Component, View} from 'angular2/core';
import {Http, HTTP_PROVIDERS} from 'angular2/http';
import {NgFor} from 'angular2/common';
import Rx from 'rxjs/Rx';
import {MATERIAL_DIRECTIVES} from 'ng2-material/all';

@Component({
  selector: 'my-app',
  providers: [HTTP_PROVIDERS]
})
@View({
  templateUrl: "app/hello.html",
  directives: [NgFor,MATERIAL_DIRECTIVES]
})
export class AppComponent {
  static get parameters(){
    return [[Http]];
  }

  constructor(http){
    this.name = "world";
    this.http = http;   
  }

  getNotes(){
    this.http.get('/test')
        .map(res => res.json())
        .subscribe(
            res => {this.notes = res}, 
            err => console.error(err),
            () => console.log("Notes received"));
  }
}

日志文件显示:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs', '/usr/local/bin/npm', 'run', 'build' ]
2 info using npm@3.3.12
3 info using node@v5.2.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle angular2_babel@1.0.0~prebuild: angular2_babel@1.0.0
6 silly lifecycle angular2_babel@1.0.0~prebuild: no script for prebuild, continuing
7 info lifecycle angular2_babel@1.0.0~build: angular2_babel@1.0.0
8 verbose lifecycle angular2_babel@1.0.0~build: unsafe-perm in lifecycle true
9 verbose lifecycle angular2_babel@1.0.0~build: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/khaeden/Projects/vNotes/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
10 verbose lifecycle angular2_babel@1.0.0~build: CWD: /home/khaeden/Projects/vNotes
11 silly lifecycle angular2_babel@1.0.0~build: Args: [ '-c',
11 silly lifecycle   'jspm bundle-sfx --minify --inject app/boot public/build/bundle.js' ]
12 silly lifecycle angular2_babel@1.0.0~build: Returned: code: 1  signal: null
13 info lifecycle angular2_babel@1.0.0~build: Failed to exec build script
14 verbose stack Error: angular2_babel@1.0.0 build: `jspm bundle-sfx --minify --inject app/boot public/build/bundle.js`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack     at emitTwo (events.js:88:13)
14 verbose stack     at EventEmitter.emit (events.js:173:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:88:13)
14 verbose stack     at ChildProcess.emit (events.js:173:7)
14 verbose stack     at maybeClose (internal/child_process.js:819:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:212:5)
15 verbose pkgid angular2_babel@1.0.0
16 verbose cwd /home/khaeden/Projects/vNotes
17 error Linux 3.19.0-47-generic
18 error argv "/usr/bin/nodejs" "/usr/local/bin/npm" "run" "build"
19 error node v5.2.0
20 error npm  v3.3.12
21 error code ELIFECYCLE
22 error angular2_babel@1.0.0 build: `jspm bundle-sfx --minify --inject app/boot public/build/bundle.js`
22 error Exit status 1
23 error Failed at the angular2_babel@1.0.0 build script 'jspm bundle-sfx --minify --inject app/boot public/build/bundle.js'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the angular2_babel package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     jspm bundle-sfx --minify --inject app/boot public/build/bundle.js
23 error You can get their info via:
23 error     npm owner ls angular2_babel
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]

提前致谢。

0 个答案:

没有答案