node.js – npm是什么意思,“跳过失败的可选依赖关系”?

节点和npm的最新版本导致运行业务的问题。当我尝试安装karma-cli npm i -g karma karma-cli我得到以下警告:

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

当我尝试运行业务测试,我得到以下错误

"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

我的配置说明如下:

Node version: v4.3.0
NPM version: 3.7.3

任何帮助将非常感谢修复这个,我无法获得业力版本安装,我认为它没有正确安装在我的机器。

解决方法

这不是错误。这是一个警告,fseventsd是Mac OS特有的,不能在Linux上安装。

没有必要惊慌,需要fsevent的软件包仍然可以工作 – 这就是为什么它是一个可选的依赖关系。

因为许多人对此感到困惑(特别是因为以前这是一个真正的错误,而不是一个警告)有an open bug to make the current warning into an INFO instead

相关文章

这篇文章主要介绍“基于nodejs的ssh2怎么实现自动化部署”的...
本文小编为大家详细介绍“nodejs怎么实现目录不存在自动创建...
这篇“如何把nodejs数据传到前端”文章的知识点大部分人都不...
本文小编为大家详细介绍“nodejs如何实现定时删除文件”,内...
这篇文章主要讲解了“nodejs安装模块卡住不动怎么解决”,文...
今天小编给大家分享一下如何检测nodejs有没有安装成功的相关...