简体   繁体   English

未知的对等关系eslint@2.7.0

[英]UNMET PEER DEPENDENCY eslint@2.7.0

I've been having this headache all day today, essentially deploying to aws results in following error: 我今天整天都在头疼,本质上部署到aws会导致以下错误:

npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package eslint@2.7.0 does not satisfy its siblings' peerDependencies requirements!

which I believe is cause by npm error, after installing all my packages I get this in console (note this is just a little peace of output related to what I believe causes error, mainly this first line UNMET PEER DEPENDENCY eslint@2.7.0 ): 我相信这是npm错误引起的,在安装完我的所有软件包后,我在控制台中得到了这个(请注意,这只是与我认为会引起错误的输出有关的一点和平,主要是第一行UNMET PEER DEPENDENCY eslint@2.7.0 ) :

├─┬ UNMET PEER DEPENDENCY eslint@2.7.0
│ ├─┬ chalk@1.1.3 
│ │ ├── ansi-styles@2.2.1 
│ │ ├── has-ansi@2.0.0 
│ │ └── supports-color@2.0.0 
│ ├─┬ concat-stream@1.5.1 
│ │ ├── inherits@2.0.1 
│ │ ├─┬ readable-stream@2.0.6 
│ │ │ ├── isarray@1.0.0 
│ │ │ ├── process-nextick-args@1.0.6 
│ │ │ └── util-deprecate@1.0.2 
│ │ └── typedarray@0.0.6 
│ ├─┬ doctrine@1.2.1 
│ │ ├── esutils@1.1.6 
│ │ └── isarray@1.0.0 
│ ├─┬ es6-map@0.1.3 
│ │ ├── d@0.1.1 
│ │ ├── es5-ext@0.10.11 
│ │ ├── es6-iterator@2.0.0 
│ │ └── event-emitter@0.3.4 
│ ├─┬ escope@3.6.0 
│ │ ├── es6-weak-map@2.0.1 
│ │ └─┬ esrecurse@4.1.0 
│ │   └── estraverse@4.1.1 
│ ├─┬ espree@3.1.3 
│ │ ├── acorn@3.0.4 
│ │ └─┬ acorn-jsx@2.0.1 
│ │   └── acorn@2.7.0 
│ ├── estraverse@4.2.0 
│ ├── esutils@2.0.2 
│ ├─┬ file-entry-cache@1.2.4 
│ │ └─┬ flat-cache@1.0.10 
│ │   ├─┬ del@2.2.0 
│ │   │ ├─┬ globby@4.0.0 
│ │   │ │ └── glob@6.0.4 
│ │   │ ├── is-path-cwd@1.0.0 
│ │   │ ├─┬ is-path-in-cwd@1.0.0 
│ │   │ │ └── is-path-inside@1.0.0 
│ │   │ └── pify@2.3.0 
│ │   ├── read-json-sync@1.1.1 
│ │   └── write@0.2.1 
│ ├─┬ glob@7.0.3 
│ │ ├─┬ inflight@1.0.4 
│ │ │ └── wrappy@1.0.1 
│ │ └── once@1.3.3 
│ ├── globals@9.4.0 
│ ├── ignore@3.1.1 
│ ├── imurmurhash@0.1.4 
│ ├─┬ inquirer@0.12.0 
│ │ ├── ansi-escapes@1.3.0 
│ │ ├── ansi-regex@2.0.0 
│ │ ├─┬ cli-cursor@1.0.2 
│ │ │ └─┬ restore-cursor@1.0.1 
│ │ │   ├── exit-hook@1.1.1 
│ │ │   └── onetime@1.1.0 
│ │ ├── cli-width@2.1.0 
│ │ ├── figures@1.5.0 
│ │ ├─┬ readline2@1.0.1 
│ │ │ ├── code-point-at@1.0.0 
│ │ │ ├── is-fullwidth-code-point@1.0.0 
│ │ │ └── mute-stream@0.0.5 
│ │ ├── run-async@0.1.0 
│ │ ├── rx-lite@3.1.2 
│ │ ├── string-width@1.0.1 
│ │ └── through@2.3.8 
│ ├─┬ is-my-json-valid@2.13.1 
│ │ ├── generate-function@2.0.0 
│ │ ├─┬ generate-object-property@1.2.0 
│ │ │ └── is-property@1.0.2 
│ │ ├── jsonpointer@2.0.0 
│ │ └── xtend@4.0.1 
│ ├─┬ is-resolvable@1.0.0 
│ │ └── tryit@1.0.2 
│ ├─┬ js-yaml@3.5.5 
│ │ ├─┬ argparse@1.0.7 
│ │ │ └── sprintf-js@1.0.3 
│ │ └── esprima@2.7.2 
│ ├─┬ json-stable-stringify@1.0.1 
│ │ └── jsonify@0.0.0 
│ ├─┬ optionator@0.8.1 
│ │ ├── deep-is@0.1.3 
│ │ ├── fast-levenshtein@1.1.3 
│ │ ├── levn@0.3.0 
│ │ ├── prelude-ls@1.1.2 
│ │ ├── type-check@0.3.2 
│ │ └── wordwrap@1.0.0 
│ ├── path-is-inside@1.0.1 
│ ├── pluralize@1.2.1 
│ ├── progress@1.1.8 
│ ├─┬ require-uncached@1.0.2 
│ │ ├─┬ caller-path@0.1.0 
│ │ │ └── callsites@0.2.0 
│ │ └── resolve-from@1.0.1 
│ ├── shelljs@0.6.0 
│ ├── strip-json-comments@1.0.4 
│ ├─┬ table@3.7.8 
│ │ ├── bluebird@3.3.5 
│ │ ├── slice-ansi@0.0.4 
│ │ ├── tv4@1.2.7 
│ │ └── xregexp@3.1.0 
│ ├── text-table@0.2.0 
│ └─┬ user-home@2.0.0 
│   └── os-homedir@1.0.1 

I was on version 2.5.3 of eslint when I first encountered this error, since I have updated to 2.7.0, but am still seeing this and I have absolutely no idea to what is causing it. 第一次遇到此错误时,我使用的是eslint 2.5.3版本,因为我已更新至2.7.0,但仍然看到此错误,并且我完全不知道是什么原因引起的。

eslint is installed as a devDependency in the following way: eslint通过以下方式作为devDependency安装:

"devDependencies": {
  "eslint": "^2.7.0",
  ...
}

Somewhere in your output you should have a line that looks something like this: 在输出中的某处,您应该有一条看起来像这样的线:

npm WARN EPEERINVALID karma-phantomjs-launcher@0.1.4 requires a peer of karma@>=0.9 but none was installed. npm WARN EPEERINVALID karma-phantomjs-launcher@0.1.4要求karma @> = 0.9的同位体,但未安装。

This example is for Karma because I couldn't reproduce your error with ESLint, but the message should read about the same. 此示例适用于Karma,因为我无法使用ESLint重现您的错误,但消息应大致相同。

For this example, I would need to also: 对于此示例,我还需要:

npm install karma@">=0.9" --save-dev

to satisfy the unmet dependency. 以满足未满足的依赖性。


This is probably use to the deprecation of peer dependencies in NPM3. 这可能用于弃用NPM3中的对等项依赖关系。 Back in NPM2 it would have just installed the missing dependency for you, but in NPM3 they just warn you and make you deal with it yourself. 回到NPM2,它会为您安装缺少的依赖关系,但是在NPM3中,它们只是警告您并让您自己处理它。

If you recently moved to a newer version of Node & NPM then you make have moved from NPM2 to NPM3 which would cause you to start seeing these messages. 如果您最近移至Node&NPM的较新版本,则说明您已从NPM2移至NPM3,这将使您开始看到这些消息。


Edit: 编辑:

I think you might also get this message if some other package in your dependencies wants eslint of a different version, not 2.7.0. 我认为,如果依赖eslint中的某些其他软件包想要eslint其他版本(而不是2.7.0)的版本,您也可能会收到此消息。 Like maybe some other package wants eslint@^1.0.0 which isn't satisfied by eslint@^2.7.0 but it is hard to tell without the list of all dependencies. 也许就像其它的什么包要eslint@^1.0.0其不被满足eslint@^2.7.0但很难说没有所有依赖的列表。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM