error with generating new component by angular-cli
See original GitHub issueTrying generate new angular component by follow command:
$ ng g c sidebar
I got error message:
Error: Could not find an NgModule for the new component. Use the skip-import option to skip importing components in NgModule.
Could not find an NgModule for the new component. Use the skip-import option to skip importing components in NgModule.
When I try generate new component without import ( -skip-import option)
new component added with wrong path:
$ ng g c sidebar -skip-import
create src/main/webapp/src/main/webapp/app/sidebar/sidebar.component.html (26 bytes)
create src/main/webapp/src/main/webapp/app/sidebar/sidebar.component.ts (245 bytes)
JHipster Version(s)
demoissue@0.0.0 JHIPSTER-projects\demoissue
`-- generator-jhipster@4.10.0
JHipster configuration, a .yo-rc.json
file generated in the root folder
.yo-rc.json file
{ "generator-jhipster": { "promptValues": { "packageName": "com.fiveplus.cosmo" }, "jhipsterVersion": "4.10.0", "baseName": "demoissue", "packageName": "com.fiveplus.cosmo", "packageFolder": "com/fiveplus/cosmo", "serverPort": "8080", "authenticationType": "jwt", "hibernateCache": "ehcache", "clusteredHttpSession": false, "websocket": false, "databaseType": "sql", "devDatabaseType": "postgresql", "prodDatabaseType": "postgresql", "searchEngine": false, "messageBroker": false, "serviceDiscoveryType": false, "buildTool": "maven", "enableSocialSignIn": false, "enableSwaggerCodegen": false, "jwtSecretKey": "replaced-by-jhipster-info", "clientFramework": "angularX", "useSass": false, "clientPackageManager": "yarn", "applicationType": "monolith", "testFrameworks": [], "jhiPrefix": "jhi", "enableTranslation": false } }
JDL entity definitions
java version “1.8.0_101”
Java™ SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot™ 64-Bit Server VM (build 25.101-b13, mixed mode)
git version 2.13.0.windows.1
node: v6.11.3
npm: 5.4.2
bower: 1.8.0
yeoman: 2.0.0
yarn: 1.0.2
Browsers and Operating System
OS: windows 7
Issue Analytics
- State:
- Created 6 years ago
- Comments:24 (6 by maintainers)
If you are working in your current project directory, just change it to /src/app and then run the command ‘ng g c your-component’ and your component will be generated. It worked for me.
It looks you are not in the right directory -> in which directory do you run those commands?