2017-06-01 1 views
6

最近、Angular-CLIを使用して新しいAngular4プロジェクトを作成しました。angular2通知のインストール後にlintが実行されない

angular2-notificationsをインストールした後に問題が発生しましたが、ng lintコマンドを実行するとエラーが発生します。

エラー

はCの読み込みに失敗しました:\ユーザーはガブリエル\ドキュメント\ GitHubの\ GoNoGo \ GoNoGo \ node_modules \ angular2-通知\ tslint.jsonを\:カスタムルールのディレクトリが見つかりませんでした:C:ガブリエル\ドキュメント\ \ユーザーがGitHubの\ GoNoGo \ GoNoGo \ node_modules \ angular2-通知を\ \ node_modules \ codelyzer

スタックトレース:

at new FatalError (C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\tslint\lib\error.js:40:23) 
at Object.findConfiguration (C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\tslint\lib\configuration.js:47:15) 
at files.forEach (C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\@angular\cli\tasks\lint.js:36:50) 
at Array.forEach (native) 
at lintConfigs.map (C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\@angular\cli\tasks\lint.js:30:19) 
at Array.map (native) 
at Class.run (C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\@angular\cli\tasks\lint.js:21:14) 
at Class.run (C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\@angular\cli\commands\lint.js:45:25) 
at Class.Command.validateAndRun (C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\@angular\cli\ember-cli\lib\models\command.js:128:15) 
at C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\@angular\cli\ember-cli\lib\cli\cli.js:92:22 

私はこの問題のために、運が無ければGoogleに転向しました。私はGitHub repoに行って、そこにも運がなかった。

次に、angle2-notificationsパッケージの実際のtslint.jsonファイルに入りました。

は私がトップでこれを参照してください。

"rulesDirectory": [ 
    "node_modules/codelyzer" 
], 

私はそれらの3行を削除すると、ng lintコマンド作品。

私の質問は、ここに何か不足していますか?私は働くにはこのコマンドが必要です。パッケージを変更することは容認できる解決策ではないと思います。これは私自身が報告しなければならないパッケージ自体のバグですか?

ありがとう

答えて

6

は角-cli.jsonであなたの糸くずの設定からnode_modulesを除外:

"lint": [ 
    { 
     "project": "src/tsconfig.app.json", 
     "exclude": "**/node_modules/**/*" 
    }, 
    { 
     "project": "src/tsconfig.spec.json", 
     "exclude": "**/node_modules/**/*" 
    }, 
    { 
     "project": "e2e/tsconfig.e2e.json", 
     "exclude": "**/node_modules/**/*" 
    }] 

angular2-通知プロジェクトは明らかにユーザーのために糸くずngを壊すべきではありません。それでも、プロジェクトは編集すべきではないコードを埋め込むべきではないと言うのはいくぶん公正だと思います。

関連する問題