Phantomjs 角2,业力与幻影

Phantomjs 角2,业力与幻影,phantomjs,angular,karma-runner,karma-jasmine,Phantomjs,Angular,Karma Runner,Karma Jasmine,我正在学习如何用Angular 2建立业力并遇到问题 我遵循朱莉在她身上所做的,并将其应用到我的项目中 在Chrome中一切都很好,但当我想使用PhantomJS时,我会遇到一个错误。这也发生在PhantomJS2中 这就是错误: [karma]: Karma v0.13.22 server started at http://localhost:9877/ [launcher]: Starting browser PhantomJS2 [PhantomJS 2.0.0 (Mac OS X 0.

我正在学习如何用Angular 2建立业力并遇到问题

我遵循朱莉在她身上所做的,并将其应用到我的项目中

在Chrome中一切都很好,但当我想使用PhantomJS时,我会遇到一个错误。这也发生在PhantomJS2中

这就是错误:

[karma]: Karma v0.13.22 server started at http://localhost:9877/
[launcher]: Starting browser PhantomJS2
[PhantomJS 2.0.0 (Mac OS X 0.0.0)]: Connected on socket /#1yDrSei5NUX4_WYaAAAA with id 93476222
Missing error handler on `socket`.
TypeError: (msg || "").replace is not a function  
   at node_modules/karma/lib/reporter.js:45:23
karma.config.js

module.exports = function (config) {
config.set({
    basePath : '',
    frameworks : ['jasmine'],
    files : [
        // paths loaded by Karma
        {pattern : 'node_modules/systemjs/dist/system-polyfills.js', included : true, watched : true},
        {pattern : 'node_modules/systemjs/dist/system.src.js', included : true, watched : true},
        {pattern : 'node_modules/es6-shim/es6-shim.js', included : true, watched : true},
        {pattern : 'node_modules/angular2/bundles/angular2-polyfills.js', included : true, watched : true},
        {pattern : 'node_modules/rxjs/bundles/Rx.js', included : true, watched : true},
        {pattern : 'node_modules/angular2/bundles/angular2.js', included : true, watched : true},
        {pattern : 'node_modules/angular2/bundles/testing.dev.js', included : true, watched : true},

        {pattern : 'karma-test-shim.js', included : true, watched : true},
        {pattern : 'app/**/*.js', included : false, watched : true},

        {pattern : 'app/**/*.html', included : false, watched : true},
        {pattern : 'app/**/*.css', included : false, watched : true},

        {pattern : 'test/**/*.ts', included : false, watched : false},
        {pattern : 'test/**/*.js', included : false, watched : true},
        {pattern : 'test/**/*.js.map', included : false, watched : false}

    ],

    proxies : {
        "/app/" : "/base/src/app/"
    },

    reporters : ['progress'],
    port : 9876,
    colors : true,
    logLevel : config.LOG_INFO,
    autoWatch : false,
    browsers : ['PhantomJS2'],
    singleRun : true
})}
有人知道我做错了什么吗?
提前感谢

确保karma.conf.js中有这一行

{pattern: 'node_modules/systemjs/dist/system-polyfills.js', included: false, watched: false}, // PhantomJS2 (and possibly others) might require it
此github项目与phantom一起工作:


克隆它并进行播放

这有帮助吗?谢谢alecxe,但我的rx是正确的案例rx,我尝试在shim中更改导入。谢谢Eric,我还尝试添加runtime traceur并在inteliJ之外运行,但结果相同。您是否尝试过包含类似捆绑包的Web包?一周前我在工作中遇到了这个问题,我想这就解决了。不过我不确定。因此,安装karma webpack并包含如下内容:预处理器:{“Tests/***/.js”:['webpack']},