-
Notifications
You must be signed in to change notification settings - Fork 12k
ng generate with lint fix results in "no such file or directory" error #12480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you please share your You can read here why this is needed. A good way to make a minimal repro is to create a new app via As unfortunately it's all working on my machine; ng g c foo-baz
CREATE src/app/foo-baz/foo-baz.component.css (0 bytes)
CREATE src/app/foo-baz/foo-baz.component.html (26 bytes)
CREATE src/app/foo-baz/foo-baz.component.spec.ts (629 bytes)
CREATE src/app/foo-baz/foo-baz.component.ts (272 bytes)
UPDATE src/app/app.module.ts (786 bytes)
Warning: The 'deprecation' rule requires type information.
Warning: The 'no-use-before-declare' rule requires type information.
Fixed 25 error(s) in src/app/foo-baz/foo-baz.component.spec.ts
Fixed 15 error(s) in src/app/foo-baz/foo-baz.component.ts
Fixed 28 error(s) in src/app/app.module.ts |
I actually created a new project, so the
However, I forgot to mention that I am on a Windows 10 PC. |
Same issue here. It can be reproduced in a fresh angular 7 project.
Here the "no such file or directory" error shows the path incorrectly in the same way. |
After noticing, that the lint-fixing seems to work for a colleague of mine, in the exact same project, we investigated a bit more.
So it seems like the lint-fix only works, if the commands are executed at root-level. |
I just wanted to inform you, that I just upgraded to Angular 7 (CLI 7.1.0) and I am still facing the same bug. |
My project was running all fine. I was able to create components and project form the CLI normally but since yesterday it is unable to recognize 'ng' command even though I have reinstalled the CLI to the latest version. Done with cleaning the cache as well. What could be the possible reason for the same ? Any help would be appreciated ! |
@MukulMux I don't think your issue is related to this one, I suggest to open a new Issue. |
Okay. I'll start a new thread for the same. |
Happens for me as well on Windows 7 when generating components directly in the What currently works for me is generating at the root level using:
|
Having the same problem. I want to have tab and size 4 for indent, so apparently the official way is to use Before this is fixed, I will have to reformat every generated codes by |
Same here. I also added the So what is the status on this? There seems to be a solution which has not been merged into the angular master branch. |
Also having this problem. |
Closing since |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug Report or Feature Request (mark with an
x
)Command (mark with an
x
)Versions
NodeJS: v8.10.0
npm: 6.4.1
Repro steps
ng new
angular.json
-File and add a Schematics-Configuration with thelintFix
-Option:This Code can be inserted right before the
projects
-Node.Examples are:
ng generate component
The log given by the failure
Note, that it looks for
project\src\app\src\app\test
instead ofproject\src\app\test
Desired functionality
I would expect, that the
lintFix
-Option fixes all lint errors in the newly generatedcomponent.ts
andcomponent.spec.ts
files. However, those files still use "LF" instead of "CRLF" and they still have Single-quotes instead of Double-Quotes.Mention any other details that might be useful
The
lintFix
-Option disappeared in angular/[email protected] as mentioned in #11034 and came back with #11648.It should be part of angular/[email protected] and it is part of it's schematics schema file
The text was updated successfully, but these errors were encountered: