I have created a new Angular4 project using Angular-CLI recently.
The problem I am having is after installing angular2-notifications , I get an error when running the ng lint
command.
Error :
Failed to load C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\angular2-notifications\tslint.json: Could not find custom rule directory: C:\Users\Gabriel\Documents\GitHub\Go-NoGo\GoNoGo\node_modules\angular2-notifications\node_modules\codelyzer
Stacktrace :
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
I have turned to Google for this issue, without any luck. I have been to the GitHub repo and had no luck there either.
Then I went in the actual tslint.json
file of angular2-notifications package.
I see this at the top :
"rulesDirectory": [
"node_modules/codelyzer"
],
When I remove those 3 lines, the ng lint
command works.
My question is, am I missing something here? I need this command to work and I don't think that modifying the package is an acceptable solution. Is this a bug in the package itself which I should report to them?
Thank you
angular-cli.json
file has been renamed/replaced withangular.json
in version 6 of Angular. The format of the file changed as well. See https://mcmap.net/q/377887/-where-is-the-file-angular-cli-json-in-the-new-angular-cli-version – Abbotsen