2016-12-07 8 views
1

私はESLintとGulpを使用して私の会社のコードベースにAirbnbスタイルガイドを追加しようとしています。私は、次のようなエラーに実行しているよ:ESLint with Gulp

eslint.gulp.js

export default (gulp, plugins, config) => { 
return gulp.src([ 
    `${config.SRC}/**/*.js`, 
    `!${config.SRC}/**/__generated/*.js`, 
    `!${config.SRC}/libraries/**`, 
    `!**/node_modules/**` 
]) 
.pipe(plugins.errorHandler()) 
.pipe(plugins.eslint({ 
    "extends": "airbnb-base" 
}) 
) 
.pipe(plugins.eslint.format()) 
.pipe(plugins.eslint.failAfterError()); 
} 

.eslintrc file

{ 
    "env": { 
    "es6": true, 
    "browser": true 
    }, 
    "extends": "airbnb-base", 
    "rules": {} 
} 

私が間違っているかもしれないものの任意のアイデア:ここ

Error: Failed to load plugin import: Cannot find module 'eslint-plugin-import' 
Referenced from: airbnb-base 
Referenced from: 
at Function.Module._resolveFilename (module.js:339:15) 
at Function.Module._load (module.js:290:25) 
at Module.require (module.js:367:17) 

は私の現在の設定です?

答えて

0

私は

+0

うん、それはあります示唆、私はそのpeerDependencyとして定義されている場合、ウルNPMバージョンを確認 – Kent

+0

参照の問題だと思いますnpmのバージョンは正しくインストールできません。私はupdate npmがnode_modulesを再インストールすることをお勧めします –

+0

ちょうどそれを試みても動作していないようです。 – Kent

関連する問題