1

我最近将操作系统从 El Capitan 升级到 Sierra。现在我无法运行 JS 单元测试套件,它在控制台中出现以下错误。

 [exec] INFO [framework.browserify]: bundle built
 [exec] INFO [karma]: Karma v0.12.35 server started at http://localhost:9876/
 [exec] INFO [launcher]: Starting browser PhantomJS
 [exec] ERROR [launcher]: Cannot start PhantomJS
 [exec]     
 [exec] INFO [launcher]: Trying to start PhantomJS again (1/2).
 [exec] ERROR [launcher]: Cannot start PhantomJS
 [exec]     
 [exec] INFO [launcher]: Trying to start PhantomJS again (2/2).
 [exec] ERROR [launcher]: Cannot start PhantomJS
 [exec]     
 [exec] ERROR [launcher]: PhantomJS failed 2 times (cannot start). Giving up.
 [exec] [11:43:19] 'test' errored after 14 s
 [exec] [11:43:19] Error: 1
 [exec]   at formatError (/usr/local/lib/node_modules/gulp/bin/gulp.js:169:10)
 [exec]   at Gulp.<anonymous> (/usr/local/lib/node_modules/gulp/bin/gulp.js:195:15)
 [exec]   at emitOne (events.js:90:13)
 [exec]   at Gulp.emit (events.js:182:7)
 [exec]   at Gulp.Orchestrator._emitTaskDone (/Users/ssrp/workspace/clickhq-v2/frontend/node_modules/orchestrator/index.js:264:8)
 [exec]   at /Users/ssrp/workspace/clickhq-v2/frontend/node_modules/orchestrator/index.js:275:23
 [exec]   at finish (/Users/ssrp/workspace/clickhq-v2/frontend/node_modules/orchestrator/lib/runTask.js:21:8)
 [exec]   at cb (/Users/ssrp/workspace/clickhq-v2/frontend/node_modules/orchestrator/lib/runTask.js:29:3)
 [exec]   at removeAllListeners (/Users/ssrp/workspace/clickhq-v2/frontend/node_modules/karma/lib/server.js:218:7)
 [exec]   at Server.<anonymous> (/Users/ssrp/workspace/clickhq-v2/frontend/node_modules/karma/lib/server.js:229:9)
 [exec]   at Server.g (events.js:273:16)
 [exec]   at emitNone (events.js:85:20)
 [exec]   at Server.emit (events.js:179:7)
 [exec]   at emitCloseNT (net.js:1525:8)
 [exec]   at _combinedTickCallback (internal/process/next_tick.js:71:11)
 [exec]   at process._tickCallback (internal/process/next_tick.js:98:9)

寻找解决方案,但找不到。谁能给我一个理由和方向。谢谢。

4

2 回答 2

1

我的问题不在于 Phantom js,我必须升级“grunt-contrib-jasmine”:“^1.0.3”。

于 2016-10-23T10:02:31.963 回答
1

升级到 PhantomJS v2.x 解决了这个问题。

于 2016-09-29T18:18:13.783 回答