Javascript eslint-config谷歌没有';t检测全局安装的eslint

Javascript eslint-config谷歌没有';t检测全局安装的eslint,javascript,atom-editor,eslint,linter,eslintrc,Javascript,Atom Editor,Eslint,Linter,Eslintrc,每当我试图通过 npm安装-g eslint config google 我明白了 npm WARN eslint-config-google@0.9.1 requires a peer of eslint@>=4.1.1 but none is installed. You must install peer dependencies yourself. 但是当我做eslint--v只是为了再次确认时,我得到了v4.16.0 我不知道我错在哪里 相关问题:另外,我在我的~(主)文件夹

每当我试图通过

npm安装-g eslint config google

我明白了

npm WARN eslint-config-google@0.9.1 requires a peer of eslint@>=4.1.1 but none is installed.
You must install peer dependencies yourself.
但是当我做
eslint--v
只是为了再次确认时,我得到了
v4.16.0

我不知道我错在哪里


相关问题:另外,我在我的
~
(主)文件夹中有一个全局默认的
.eslintrc
文件,我从Atom中的
linter-eslint
包指向该文件。当我在Atom上保存任何.js文件时

找不到引用自:/Users/aakashverma/.eslintrc.js的模块“eslint config google”

这是我在
~
中的
.eslintrc.js
文件:

module.exports = {
  "extends": ["eslint:recommended", "google"],
  "rules": {
    "indent": [
      "error",
      4
    ],
    "linebreak-style": [
      "error",
      "unix"
    ],
    "quotes": [
      "error",
      "single"
    ],
    "semi": [
      "error",
      "always"
    ],
    // allow console and debugger in development
    'no-console': process.env.NODE_ENV === 'production' ? 2 : 0,
    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
  }
}

好的,我不确定这是缓存问题还是什么,但我不认为是因为我一直在重新启动Atom和zsh,但下面是它的工作原理:

在Atom中,我将
.eslintrc Path
更改为
~/.eslintrc.js
,并将
使用全局ESlint安装
更改为“选中”

这是我的
.eslintrc
,在Atom中指向的主文件夹中

最后,为了使其在启用
Use global ESlint installation
的情况下工作,我以这种方式在我的
$PATH
变量中包括
ESlint config google
ESlint

/usr/local/bin
/usr/bin
/bin
/usr/sbin
/sbin
/Users/aakashverma/.nvm/versions/node/v9.4.0/lib/node_modules/eslint/
/Users/aakashverma/.nvm/versions/node/v9.4.0/lib/node_modules/eslint-config-google/

请参阅@ginna的回答和我的评论。

您对eslint可执行文件的Atom设置是什么?您可以尝试将其直接指向模块文件夹,例如~/node\u modules/eslint/bin@PapasmileMy.eslintrc path被设置为
~/.eslintrc.js
文件的实际位置。任何项目读取或访问该文件都没有问题。只是它无法检测到
eslint config google
。啊,明白了。我认为atom不使用全局插件,看@Papasmile,是的,伙计。请查看我的回答。如果关闭“使用全局”,则表示您安装了本地软件包,并且您已使用$PATH将全局安装的软件包添加到运行时,因此它看起来像本地文件。。。。不管怎么说,所有这些都有点愚蠢,所以+1将你的经验发布到这可能是一个找出根本原因的好地方:)如果你参考@darkred的评论,还有一种未经测试的方法。