2016-10-07 11 views
1

EDIT2:これで動作します。すべてのローカルeslintパッケージを削除しなければならなかった。すべてが良いです!Eslintとプラグインをインストールしている未対応のピア依存関係

編集:さて、特定のバージョンをインストールした後、それは(^ 1.16.0)と不満を表明しました。コマンドラインで再び機能します。しかし、それは悲しいことに崇拝の中では役に立たなかった。ここで間違っている設定がありますか?

誤って同じパッケージを再度インストールする前に、この機能が動作していましたが、破損しました。最終的に私はESLINTをSublimeと連携させようとしています。私はそこに何も変更していないので、Sublimeのすべてが正しいと思います。 Eslintがもう動作しなくなっているだけです。これは 'eslint app.jsx'などのショーです(下記参照)。

このエラーは、eslint-plugin-importに対して未対応のピア依存関係のエラーが発生します。

aa:myResolutions Andreas$ sudo npm install -g eslint eslint-plugin-import 

Password: 

/usr/local/bin/eslint -> /usr/local/lib/node_modules/eslint/bin/eslint.js 

/usr/local/lib 

├── [email protected] 

└── [email protected] 


aa:myResolutions Andreas$ sudo npm install -g eslint eslint-plugin-import 
eslint-config-airbnb eslint-plugin-react eslint-plugin-jsx-a11y 

/usr/local/bin/eslint -> /usr/local/lib/node_modules/eslint/bin/eslint.js 

/usr/local/lib 

├── [email protected] 

├─┬ esli[email protected] 

│ └── UNMET PEER DEPENDENCY [email protected]^1.16.0 

├── UNMET PEER DEPENDENCY [email protected] 

├── [email protected] 

└── [email protected] 


npm WARN [email protected] requires a peer of eslint-plugin- 
[email protected]^1.16.0 but none was installed. 

npm WARN [email protected] requires a peer of eslint-plugin- 
[email protected]^1.16.0 but none was installed. 

aa:myResolutions Andreas$ eslint App.jsx 


Oops! Something went wrong! :(


ESLint couldn't find the plugin "eslint-plugin-import". This can happen for a 
couple different reasons: 


1. If ESLint is installed globally, then make sure eslint-plugin-import is 
also installed globally. A globally-installed ESLint cannot find a locally- 
installed plugin. 


2. If ESLint is installed locally, then it's likely that the plugin isn't 
installed correctly. Try reinstalling by running the following: 

npm i [email protected] --save-dev 

私はそれを得ていません。私は最初にそれをインストールしました。しかし、それはもはやインストールされていないのですか?あるいは、少なくともそれは他のパッケージでは見つけられませんか?

これで私の頭を1日以上掻いていました。すべてのプラグインはグローバルにインストールされているので問題にならないはずです。そして、私はノード/ npmを完全に再インストールしましたが、何も役立たないようです。

これを解決する方法はありますか?

答えて

4

梱包されたエアバッグについてのお知らせhttps://www.npmjs.com/package/eslint-config-airbnbインストール前にいくつかの追加情報が記載されています。

export PKG=eslint-config-airbnb; npm info "$PKG" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG"

この生成されます。ターミナルの実行で

npm uninstall --save-dev eslint-plugin-react npm uninstall --save-dev eslint-plugin-jsx-a11y npm uninstall --save-dev eslint-plugin-import

最初にインストールされたすべてのパッケージを削除し、彼らは次のようにする必要があります正しい依存関係

npm install --save-dev eslint-config-airbnb [email protected]^#.#.# [email protected]^#.#.# [email protected]^#.#.# [email protected]^#.#.#

0

チェックこの回答here:アンインストールした後

npm i -g eslint-config-airbnb-standard 
eslint -v 
0

これらのパッケージ:eslint - プラグインのインポート、eslint-プラグインJSX-a11y、eslint-プラグインJSX-a11y、eslint-あなたはそれらの依存関係と一緒にeslint-CONFIG-airbnbをインストールすることができます プラグイン-反応:

NPMについて5+: npx install-peerdeps --dev eslint-config-airbnb

npmの場合< 5: ( export PKG=eslint-config-airbnb; npm info "[email protected]" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "[email protected]" )

関連する問題