30

Latest version of node and npm causing problems in running karma. When I try to install karma-cli npm i -g karma karma-cli I get following warning:

npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.0.8
npm WARN optional Skipping failed optional dependency /gulp-karma/chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents@0.2.1

And when I try to run karma test, I get following error:

"C:\Program Files\nodejs\node.exe" "C:\Program Files (x86)\JetBrains\WebStorm 11.0.3\plugins\js-karma\js_reporter\karma-intellij\lib\intellijServer.js" --karmaPackageDir=C:\Users\xxx\AppData\Roaming\npm\node_modules\karma --configFile=C:\Users\xxx\Documents\project\karma.conf.js
26 02 2016 11:24:07.871:WARN [plugin]: Cannot find plugin "karma-chrome-launcher".
  Did you forget to install it ?
  npm install karma-chrome-launcher --save-dev
26 02 2016 11:24:07.877:WARN [plugin]: Cannot find plugin "karma-firefox-launcher".
  Did you forget to install it ?
  npm install karma-firefox-launcher --save-dev
26 02 2016 11:24:07.878:WARN [plugin]: Cannot find plugin "karma-phantomjs-launcher".
  Did you forget to install it ?
  npm install karma-phantomjs-launcher --save-dev
26 02 2016 11:24:07.879:WARN [plugin]: Cannot find plugin "karma-jasmine".
  Did you forget to install it ?
  npm install karma-jasmine --save-dev
26 02 2016 11:24:07.880:WARN [plugin]: Cannot find plugin "karma-junit-reporter".
  Did you forget to install it ?
  npm install karma-junit-reporter --save-dev
26 02 2016 11:24:07.885:WARN [plugin]: Cannot find plugin "karma-teamcity-reporter".
  Did you forget to install it ?
  npm install karma-teamcity-reporter --save-dev
26 02 2016 11:24:07.887:WARN [plugin]: Cannot find plugin "karma-coverage".
  Did you forget to install it ?
  npm install karma-coverage --save-dev
26 02 2016 11:24:07.888:WARN [plugin]: Cannot find plugin "karma-jasmine-html-reporter".
  Did you forget to install it ?
  npm install karma-jasmine-html-reporter --save-dev
26 02 2016 11:24:07.889:WARN [plugin]: Cannot find plugin "karma-ng-html2js-preprocessor".
  Did you forget to install it ?
  npm install karma-ng-html2js-preprocessor --save-dev
26 02 2016 11:24:07.890:WARN [plugin]: Cannot find plugin "karma-browserify".
  Did you forget to install it ?
  npm install karma-browserify --save-dev
26 02 2016 11:24:07.893:WARN [preprocess]: Can not load "coverage", it is not registered!
  Perhaps you are missing some plugin?
26 02 2016 11:24:07.893:WARN [preprocess]: Can not load "ng-html2js", it is not registered!
  Perhaps you are missing some plugin?
26 02 2016 11:24:07.893:WARN [preprocess]: Can not load "browserify", it is not registered!
  Perhaps you are missing some plugin?
26 02 2016 11:24:07.901:WARN [reporter]: Can not load "coverage", it is not registered!
  Perhaps you are missing some plugin?
26 02 2016 11:24:07.901:WARN [reporter]: Can not load "junit", it is not registered!
  Perhaps you are missing some plugin?
C:\Users\xxx\AppData\Roaming\npm\node_modules\karma\node_modules\di\lib\injector.js:9
      throw error('No provider for "' + name + '"!');
      ^

Error: No provider for "framework:jasmine"! (Resolving: framework:jasmine)
    at error (C:\Users\xxx\AppData\Roaming\npm\node_modules\karma\node_modules\di\lib\injector.js:22:12)
    at Object.parent.get (C:\Users\xxx\AppData\Roaming\npm\node_modules\karma\node_modules\di\lib\injector.js:9:13)
    at get (C:\Users\xxx\AppData\Roaming\npm\node_modules\karma\node_modules\di\lib\injector.js:54:19)
    at C:\Users\xxx\AppData\Roaming\npm\node_modules\karma\lib\server.js:138:20
    at Array.forEach (native)
    at Server._start (C:\Users\xxx\AppData\Roaming\npm\node_modules\karma\lib\server.js:137:21)
    at invoke (C:\Users\xxx\AppData\Roaming\npm\node_modules\karma\node_modules\di\lib\injector.js:75:15)
    at Server.start (C:\Users\xxx\AppData\Roaming\npm\node_modules\karma\lib\server.js:102:18)
    at Object.<anonymous> (C:\Program Files (x86)\JetBrains\WebStorm 11.0.3\plugins\js-karma\js_reporter\karma-intellij\lib\intellijServer.js:12:13)
    at Module._compile (module.js:410:26)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3

Process finished with exit code 1

My configuration specification as follows:

Node version: v4.3.0
NPM version: 3.7.3

I am not able to get karma version installed, I think it's not installed properly in my machine.

halfer
  • 18,701
  • 13
  • 79
  • 158
Mithun Shreevatsa
  • 2,689
  • 7
  • 34
  • 71

1 Answers1

48

This is not an error. It is a warning that fseventsd, which is Mac OS specific, cannot be installed on Linux.

There is no need to be alarmed, and the package that needs fsevents will still work - that's why it's an optional dependency.

Since many people are confused about this (particularly since this used to be a real error, not a warning) there's an open bug to make the current warning into an INFO instead

Additionally yarn already does this.

mikemaccana
  • 81,787
  • 73
  • 317
  • 396
  • 2
    Thanks for it. By upgrading my nodejs to latest version, it helped to get this resolved. I am not getting any error for now. But when i run the karma test, i receive the following error as specified in question. But, when i check inside node_modules, i see: karma-chrome-launcher got installed, if i go inside, node_modules for that particular page has not been created. So like that for many packages have the same kind of problem. So i am doing it manually to install its dependencies. Is there any way to overcome if dis is somewhere related to npm pblm or its karma authors pblm. – Mithun Shreevatsa Feb 26 '16 at 12:08
  • What does `npm ls karma-chrome-launcher` give you? – mikemaccana Feb 26 '16 at 12:43
  • @mikemaccana This is MAC OSX specific you say. When I do `npm install` in vagrant I get the warning (indeed no error) but still elixir doesn't install so I can't use sass. When I run `npm install` outside vagrant it runs without warning but still no elixir installed... Conclusion I can't use gulp (prob because of thie sfevents). Any help? – nclsvh Nov 15 '16 at 11:17
  • @NicolasV The warning will occur anywhere you install a package that isn't relevant for the OS. Eg, install a Windows package on Linux, a Linux specific package on Mac OS, etc. It sounds like you have a prob installing elixir that's separate - best asked as a different question. – mikemaccana Nov 16 '16 at 15:23
  • @mikemaccana ok sure, i'll look elsewhere for this. Only indication I get from anything going wrong is the warning from OP. Figured it was linked somehow. – nclsvh Nov 16 '16 at 16:03
  • 4
    Is there a way to suppress it somehow? It bothers me it pops out every now and then... – Konrad Viltersten Jan 17 '17 at 23:12
  • I am getting this in VSO in one build definition which fails because of this. How to ignore it? – Andry Apr 17 '18 at 09:46