无法在grunt watch中读取null的属性'write'

时间:2018-01-10 09:20:30

标签: javascript angularjs gruntjs karma-runner

我正在尝试使用grunt运行角度项目,但是当我运行此命令grunt watch时,它会被警告中止。

Running "karma:unit" (karma) task
Warning: Cannot read property 'write' of null use --force to continue
Aborted due to warnings.

但是当我使用命令grunt watch --force时,我能够在浏览器中查看我的角度应用程序,但是在命令窗口中有错误说

Running "delta" task
Waiting...
D:\Projects\sampleweb\node_modules\karma\lib\logger.js:59
  if (helper.isDefined(config.colors)) {
                              ^

TypeError: Cannot read property 'colors' of null
    at Object.setupFromConfig (D:\Projects\sampleweb\node_modules\karma\lib\log
ger.js:59:31)
    at new Server (D:\Projects\sampleweb\node_modules\karma\lib\server.js:50:10
)
    at ReadStream.<anonymous> (D:\Projects\sampleweb\node_modules\grunt-karma\l
ib\background.js:4:16)
    at emitNone (events.js:106:13)
    at ReadStream.emit (events.js:208:7)
    at emitReadable_ (_stream_readable.js:513:10)
    at emitReadable (_stream_readable.js:507:7)
    at ReadStream.Readable.read (_stream_readable.js:384:7)
    at ReadStream.Socket.read (net.js:362:43)
    at nReadingNextTick (_stream_readable.js:797:8)
    at _combinedTickCallback (internal/process/next_tick.js:135:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
    at Function.Module.runMain (module.js:686:11)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

我无法弄清楚出了什么问题。我试图谷歌相同的错误,但找不到任何解决方案。

这是我的package.json文件。

{
  "name": "sample pro",
  "version": "2.10.3",
  "author": "sample",
  "devDependencies": {
    "grunt": "~0.4.2",
    "grunt-contrib-jshint": "^0.9.2",
    "grunt-contrib-nodeunit": "~0.2.0",
    "grunt-contrib-uglify": "~0.2.2",
    "grunt-contrib-clean": "^0.5.0",
    "grunt-contrib-copy": "^0.5.0",
    "grunt-contrib-concat": "^0.3.0",
    "grunt-contrib-watch": "^0.6.1",
    "grunt-contrib-coffee": "^0.10.1",
    "grunt-contrib-less": "^0.11.4",
    "grunt-coffeelint": "0.0.8",
    "grunt-html2js": "^0.2.4",
    "grunt-ngmin": "0.0.3",
    "grunt-express": "^1.4.1",
    "karma": "^1.6.0",
    "grunt-karma": "^0.12.2",
    "karma-jasmine": "^0.1.5",
    "karma-firefox-launcher": "^0.1.3",
    "karma-chrome-launcher": "^0.1.3",
    "karma-phantomjs-launcher": "^0.1.3",
    "karma-coffee-preprocessor": "^0.2.1",
    "lodash": "^2.4.1"
  }
}

0 个答案:

没有答案