Bug Report or Feature Request (mark with an x)
- [x] bug report -> please search issues before submitting
- [ ] feature request
Area
- [ ] devkit
- [ ] schematics
(Unsure at this time which area it affects.)
Versions
Node: 8.11.3
npm: 6.1.0
Angular CLI (global): 6.0.8
Repro steps
When ng update @angular/cli is run on an Angular 5 project, the angular.json file that gets generated has an improper setting in the e2e section of the configuration that interferes with the behavior of ng generate.
"test-ng5-app-e2e": {
"root": "",
"sourceRoot": "e2e",
...
}
Steps:
- Create a new Angular 5 project (I used these steps: https://stackoverflow.com/a/50467119/6189080)
- Install the latest CLI version on the project (
npm install @angular/cli@6.0.8)
- Run
ng update @angular/cli on the project
- From the source folder of the project, run:
ng generate service test --dry-run
ng generate component test --dry-run
The log given by the failure
$ ng g s test --dry-run
CREATE e2e/app/test.service.spec.ts (362 bytes)
CREATE e2e/app/test.service.ts (133 bytes)
NOTE: Run with "dry run" no changes were made.
$ ng g c test --dry-run
Could not find an NgModule. Use the skip-import option to skip importing in NgModule.
Desired functionality
ng generate works correctly out of the box on an upgraded application.
The simplest version would be to have the default settings match the initial settings for a newly-generated Angular 6 project.
"test-ng6-app-e2e": {
"root": "e2e/",
...
}
Mention any other details that might be useful
I first ran across the fix in this StackOverflow comment. I have reproduced this fix in my own project, and ng generate is now working as expected.
Bug Report or Feature Request (mark with an
x)Area
(Unsure at this time which area it affects.)
Versions
Node: 8.11.3
npm: 6.1.0
Angular CLI (global): 6.0.8
Repro steps
When
ng update @angular/cliis run on an Angular 5 project, theangular.jsonfile that gets generated has an improper setting in the e2e section of the configuration that interferes with the behavior ofng generate.Steps:
npm install @angular/cli@6.0.8)ng update @angular/clion the projectng generate service test --dry-runng generate component test --dry-runThe log given by the failure
Desired functionality
ng generateworks correctly out of the box on an upgraded application.The simplest version would be to have the default settings match the initial settings for a newly-generated Angular 6 project.
Mention any other details that might be useful
I first ran across the fix in this StackOverflow comment. I have reproduced this fix in my own project, and
ng generateis now working as expected.