2014-05-23 34 views
1

我試圖在OSX v10.9.3上安裝Karma。安裝Karma時node-gyp rebuild 2錯誤

我打開終端並輸入npm install -g karma。當我這樣做,我得到下面的輸出:

mc-s089979% npm install -g karma 

> [email protected] install /usr/local/lib/node_modules/karma/node_modules/chokidar/node_modules/fsevents 
> node-gyp rebuild 

    CXX(target) Release/obj.target/fse/fsevents.o 
    SOLINK_MODULE(target) Release/fse.node 
    SOLINK_MODULE(target) Release/fse.node: Finished 

> [email protected] install /usr/local/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws 
> (node-gyp rebuild 2> builderror.log) || (exit 0) 

    CXX(target) Release/obj.target/bufferutil/src/bufferutil.o 
    SOLINK_MODULE(target) Release/bufferutil.node 
    SOLINK_MODULE(target) Release/bufferutil.node: Finished 
    CXX(target) Release/obj.target/validation/src/validation.o 
    SOLINK_MODULE(target) Release/validation.node 
    SOLINK_MODULE(target) Release/validation.node: Finished 
[email protected] /usr/local/lib/node_modules/karma 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] 
├── [email protected] ([email protected]) 
├── [email protected] ([email protected], [email protected], [email protected]) 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected], [email protected]) 
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]) 
└── [email protected] ([email protected], [email protected], [email protected], [email protected]) 

如果我再嘗試通過在終端中輸入karma執行因果報應,我得到command not found: karma這表明它尚未安裝。在上面的輸出中看,有一個錯誤:(node-gyp rebuild 2> builderror.log) || (exit 0)。我在/usr/local/lib/node_modules/karma/node_modules/socket.io/node_modules/socket.io-client/node_modules/ws/builderror.log中發現了builderror.log,但它是空的。 find找不到任何其他builderror.log文件。你知道還有什麼地方可以看嗎?

我已經試過:

  • npm update
  • npm install karma
  • sudo npm install karma
  • sudo npm install -g karma

還有什麼我應該嘗試一下呢?

回答

4

看來它正在安裝。我不認爲這是因爲從命令行運行業力不起作用。然而,爲了在命令行中運行它,你需要安裝卡瑪CLI:npm install -g karma-cli

感謝@彼得·萊昂斯這個答案 - https://stackoverflow.com/a/23044629/211560

0

添加到您的.slugignore文件:

 /node_modules/grunt-karma/ 
     /node_modules/grunt-protractor-runner/ 
     /node_modules/karma/ 
     /node_modules/karma-chrome-launcher/ 
     /node_modules/karma-mocha/ 
     /node_modules/karma-ng-html2js-preprocessor/