Could not find an NgModule. Use the skip-import option to skip importing in NgModule
up vote
6
down vote
favorite
I get the error in the subject of this post when I use the CLI to create a new component: ng g c my-component --project=my-project
(No component is created)
I've seen other posts with the same error message, but none of them also include Nrwl/Nx, which I believe is somehow involved. Project started as Ng4 and was upgraded to Ng6.
Any ideas how I can fix this?
Thx.
TTE
Environment:
- Angular CLI: 6.0.8
- Node: 8.9.4
- OS: win32 x64
- Angular: 6.0.6
- @angular-devkit/architect 0.6.8
- @angular-devkit/build-angular 0.6.8
- @angular-devkit/build-optimizer 0.6.8
- @angular-devkit/core 0.6.8
- @angular-devkit/schematics 0.6.8
- @angular/cdk 6.3.1
- @angular/cli 6.0.8
- @angular/material 6.3.1
- @ngtools/webpack 6.0.8
- @schematics/angular 0.6.1
- @schematics/update 0.6.8
- rxjs 6.2.1
- typescript 2.7.2
- webpack 4.8.3
- nrwl/nx 6.1.0
UPDATE #1
I tried dropping the --project
flag entirely ( so just ng g c my-component
) and still get the same problem. Not sure what that means, yet.
angular nrwl
add a comment |
up vote
6
down vote
favorite
I get the error in the subject of this post when I use the CLI to create a new component: ng g c my-component --project=my-project
(No component is created)
I've seen other posts with the same error message, but none of them also include Nrwl/Nx, which I believe is somehow involved. Project started as Ng4 and was upgraded to Ng6.
Any ideas how I can fix this?
Thx.
TTE
Environment:
- Angular CLI: 6.0.8
- Node: 8.9.4
- OS: win32 x64
- Angular: 6.0.6
- @angular-devkit/architect 0.6.8
- @angular-devkit/build-angular 0.6.8
- @angular-devkit/build-optimizer 0.6.8
- @angular-devkit/core 0.6.8
- @angular-devkit/schematics 0.6.8
- @angular/cdk 6.3.1
- @angular/cli 6.0.8
- @angular/material 6.3.1
- @ngtools/webpack 6.0.8
- @schematics/angular 0.6.1
- @schematics/update 0.6.8
- rxjs 6.2.1
- typescript 2.7.2
- webpack 4.8.3
- nrwl/nx 6.1.0
UPDATE #1
I tried dropping the --project
flag entirely ( so just ng g c my-component
) and still get the same problem. Not sure what that means, yet.
angular nrwl
add a comment |
up vote
6
down vote
favorite
up vote
6
down vote
favorite
I get the error in the subject of this post when I use the CLI to create a new component: ng g c my-component --project=my-project
(No component is created)
I've seen other posts with the same error message, but none of them also include Nrwl/Nx, which I believe is somehow involved. Project started as Ng4 and was upgraded to Ng6.
Any ideas how I can fix this?
Thx.
TTE
Environment:
- Angular CLI: 6.0.8
- Node: 8.9.4
- OS: win32 x64
- Angular: 6.0.6
- @angular-devkit/architect 0.6.8
- @angular-devkit/build-angular 0.6.8
- @angular-devkit/build-optimizer 0.6.8
- @angular-devkit/core 0.6.8
- @angular-devkit/schematics 0.6.8
- @angular/cdk 6.3.1
- @angular/cli 6.0.8
- @angular/material 6.3.1
- @ngtools/webpack 6.0.8
- @schematics/angular 0.6.1
- @schematics/update 0.6.8
- rxjs 6.2.1
- typescript 2.7.2
- webpack 4.8.3
- nrwl/nx 6.1.0
UPDATE #1
I tried dropping the --project
flag entirely ( so just ng g c my-component
) and still get the same problem. Not sure what that means, yet.
angular nrwl
I get the error in the subject of this post when I use the CLI to create a new component: ng g c my-component --project=my-project
(No component is created)
I've seen other posts with the same error message, but none of them also include Nrwl/Nx, which I believe is somehow involved. Project started as Ng4 and was upgraded to Ng6.
Any ideas how I can fix this?
Thx.
TTE
Environment:
- Angular CLI: 6.0.8
- Node: 8.9.4
- OS: win32 x64
- Angular: 6.0.6
- @angular-devkit/architect 0.6.8
- @angular-devkit/build-angular 0.6.8
- @angular-devkit/build-optimizer 0.6.8
- @angular-devkit/core 0.6.8
- @angular-devkit/schematics 0.6.8
- @angular/cdk 6.3.1
- @angular/cli 6.0.8
- @angular/material 6.3.1
- @ngtools/webpack 6.0.8
- @schematics/angular 0.6.1
- @schematics/update 0.6.8
- rxjs 6.2.1
- typescript 2.7.2
- webpack 4.8.3
- nrwl/nx 6.1.0
UPDATE #1
I tried dropping the --project
flag entirely ( so just ng g c my-component
) and still get the same problem. Not sure what that means, yet.
angular nrwl
angular nrwl
edited Jul 5 at 23:44
asked Jul 5 at 22:57
TimTheEnchanter
825517
825517
add a comment |
add a comment |
4 Answers
4
active
oldest
votes
up vote
17
down vote
Quick fix
1) Change current directory in cmd/terminal to src/app
cd src/app
(linux)
cd .srcapp
(windows)
2) Run commands now
ng g c myComponent
1
Doesn't work in nrwl/nx environment
– TimTheEnchanter
Aug 14 at 17:51
Thanks @TimTheEnchanter for pointing out. Yeah it's a fix for normal usage of angular cli.
– Debojyoti
Aug 26 at 16:48
1
The reason why this works, is that your project's default src/app folder hierarchy has been changed. Therefore, anything else that doesn't fit this situation will not work. When you generate a default project with cli, you shouldn't have to do this.
– carkod
Nov 11 at 3:57
add a comment |
up vote
0
down vote
accepted
I ended up totally deleting node_modules
, clearing out the yarn cache and then running yarn
to reinstall all packages. I also edited my angular.json
file so that my pathing looked like this for all applications and libraries:
"root": "libs/my-lib",
"sourceRoot": "libs/my-lib/src"
I'm not sure which of those fixed the problem, but all appears to be OK now. At least the immediate problem went away.
Hopefully this helps someone else.
TTE
add a comment |
up vote
0
down vote
Had same issue. Turned out to be somehow related to the name of the root component. Renaming back to 'app' resolved the problem
add a comment |
up vote
0
down vote
I had the same issue, In angular.json file, I searched for my-project-e2e (replace my-project with your project name)
and then I changed:
"root": ""
to "root": "e2e"
and saved it. Everything was working again.
The solution was specified in this link.
add a comment |
4 Answers
4
active
oldest
votes
4 Answers
4
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
17
down vote
Quick fix
1) Change current directory in cmd/terminal to src/app
cd src/app
(linux)
cd .srcapp
(windows)
2) Run commands now
ng g c myComponent
1
Doesn't work in nrwl/nx environment
– TimTheEnchanter
Aug 14 at 17:51
Thanks @TimTheEnchanter for pointing out. Yeah it's a fix for normal usage of angular cli.
– Debojyoti
Aug 26 at 16:48
1
The reason why this works, is that your project's default src/app folder hierarchy has been changed. Therefore, anything else that doesn't fit this situation will not work. When you generate a default project with cli, you shouldn't have to do this.
– carkod
Nov 11 at 3:57
add a comment |
up vote
17
down vote
Quick fix
1) Change current directory in cmd/terminal to src/app
cd src/app
(linux)
cd .srcapp
(windows)
2) Run commands now
ng g c myComponent
1
Doesn't work in nrwl/nx environment
– TimTheEnchanter
Aug 14 at 17:51
Thanks @TimTheEnchanter for pointing out. Yeah it's a fix for normal usage of angular cli.
– Debojyoti
Aug 26 at 16:48
1
The reason why this works, is that your project's default src/app folder hierarchy has been changed. Therefore, anything else that doesn't fit this situation will not work. When you generate a default project with cli, you shouldn't have to do this.
– carkod
Nov 11 at 3:57
add a comment |
up vote
17
down vote
up vote
17
down vote
Quick fix
1) Change current directory in cmd/terminal to src/app
cd src/app
(linux)
cd .srcapp
(windows)
2) Run commands now
ng g c myComponent
Quick fix
1) Change current directory in cmd/terminal to src/app
cd src/app
(linux)
cd .srcapp
(windows)
2) Run commands now
ng g c myComponent
answered Jul 12 at 4:47
Debojyoti
892515
892515
1
Doesn't work in nrwl/nx environment
– TimTheEnchanter
Aug 14 at 17:51
Thanks @TimTheEnchanter for pointing out. Yeah it's a fix for normal usage of angular cli.
– Debojyoti
Aug 26 at 16:48
1
The reason why this works, is that your project's default src/app folder hierarchy has been changed. Therefore, anything else that doesn't fit this situation will not work. When you generate a default project with cli, you shouldn't have to do this.
– carkod
Nov 11 at 3:57
add a comment |
1
Doesn't work in nrwl/nx environment
– TimTheEnchanter
Aug 14 at 17:51
Thanks @TimTheEnchanter for pointing out. Yeah it's a fix for normal usage of angular cli.
– Debojyoti
Aug 26 at 16:48
1
The reason why this works, is that your project's default src/app folder hierarchy has been changed. Therefore, anything else that doesn't fit this situation will not work. When you generate a default project with cli, you shouldn't have to do this.
– carkod
Nov 11 at 3:57
1
1
Doesn't work in nrwl/nx environment
– TimTheEnchanter
Aug 14 at 17:51
Doesn't work in nrwl/nx environment
– TimTheEnchanter
Aug 14 at 17:51
Thanks @TimTheEnchanter for pointing out. Yeah it's a fix for normal usage of angular cli.
– Debojyoti
Aug 26 at 16:48
Thanks @TimTheEnchanter for pointing out. Yeah it's a fix for normal usage of angular cli.
– Debojyoti
Aug 26 at 16:48
1
1
The reason why this works, is that your project's default src/app folder hierarchy has been changed. Therefore, anything else that doesn't fit this situation will not work. When you generate a default project with cli, you shouldn't have to do this.
– carkod
Nov 11 at 3:57
The reason why this works, is that your project's default src/app folder hierarchy has been changed. Therefore, anything else that doesn't fit this situation will not work. When you generate a default project with cli, you shouldn't have to do this.
– carkod
Nov 11 at 3:57
add a comment |
up vote
0
down vote
accepted
I ended up totally deleting node_modules
, clearing out the yarn cache and then running yarn
to reinstall all packages. I also edited my angular.json
file so that my pathing looked like this for all applications and libraries:
"root": "libs/my-lib",
"sourceRoot": "libs/my-lib/src"
I'm not sure which of those fixed the problem, but all appears to be OK now. At least the immediate problem went away.
Hopefully this helps someone else.
TTE
add a comment |
up vote
0
down vote
accepted
I ended up totally deleting node_modules
, clearing out the yarn cache and then running yarn
to reinstall all packages. I also edited my angular.json
file so that my pathing looked like this for all applications and libraries:
"root": "libs/my-lib",
"sourceRoot": "libs/my-lib/src"
I'm not sure which of those fixed the problem, but all appears to be OK now. At least the immediate problem went away.
Hopefully this helps someone else.
TTE
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
I ended up totally deleting node_modules
, clearing out the yarn cache and then running yarn
to reinstall all packages. I also edited my angular.json
file so that my pathing looked like this for all applications and libraries:
"root": "libs/my-lib",
"sourceRoot": "libs/my-lib/src"
I'm not sure which of those fixed the problem, but all appears to be OK now. At least the immediate problem went away.
Hopefully this helps someone else.
TTE
I ended up totally deleting node_modules
, clearing out the yarn cache and then running yarn
to reinstall all packages. I also edited my angular.json
file so that my pathing looked like this for all applications and libraries:
"root": "libs/my-lib",
"sourceRoot": "libs/my-lib/src"
I'm not sure which of those fixed the problem, but all appears to be OK now. At least the immediate problem went away.
Hopefully this helps someone else.
TTE
answered Jul 9 at 15:11
TimTheEnchanter
825517
825517
add a comment |
add a comment |
up vote
0
down vote
Had same issue. Turned out to be somehow related to the name of the root component. Renaming back to 'app' resolved the problem
add a comment |
up vote
0
down vote
Had same issue. Turned out to be somehow related to the name of the root component. Renaming back to 'app' resolved the problem
add a comment |
up vote
0
down vote
up vote
0
down vote
Had same issue. Turned out to be somehow related to the name of the root component. Renaming back to 'app' resolved the problem
Had same issue. Turned out to be somehow related to the name of the root component. Renaming back to 'app' resolved the problem
answered Nov 5 at 4:21
Aleksei Protopopov
1
1
add a comment |
add a comment |
up vote
0
down vote
I had the same issue, In angular.json file, I searched for my-project-e2e (replace my-project with your project name)
and then I changed:
"root": ""
to "root": "e2e"
and saved it. Everything was working again.
The solution was specified in this link.
add a comment |
up vote
0
down vote
I had the same issue, In angular.json file, I searched for my-project-e2e (replace my-project with your project name)
and then I changed:
"root": ""
to "root": "e2e"
and saved it. Everything was working again.
The solution was specified in this link.
add a comment |
up vote
0
down vote
up vote
0
down vote
I had the same issue, In angular.json file, I searched for my-project-e2e (replace my-project with your project name)
and then I changed:
"root": ""
to "root": "e2e"
and saved it. Everything was working again.
The solution was specified in this link.
I had the same issue, In angular.json file, I searched for my-project-e2e (replace my-project with your project name)
and then I changed:
"root": ""
to "root": "e2e"
and saved it. Everything was working again.
The solution was specified in this link.
edited Nov 11 at 11:19
carkod
149113
149113
answered Aug 8 at 16:25
lanchana gupta
6617
6617
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51200919%2fcould-not-find-an-ngmodule-use-the-skip-import-option-to-skip-importing-in-ngmo%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown