nativescript-schematics: "ng g c" is not working
Hi,
When I try to run the command “ng g c <componenet name>” I get the following error
Could not find module "@nativescript/schematics" from "/.../my-mobile-app".
I did run “npm i -g @nativescript/schematics” and I can create a project using the command “ng new --collection=@nativescript/schematics --name=my-mobile-app --shared”.
inside the project, I did run “npm i” to install dependencies. but the command still not working for “ng g c <componenet name>”
when I run the command “npm i @nativescript/schematic” in the project the command works
Any thoughts?
Thanks
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 1
- Comments: 18 (3 by maintainers)
In my case, the following worked. npm install --save-dev @schematics/angular npm install --save-dev @nativescript/schematics
Thank you!
@iMarwan-k @cvietor can you try:
and then try again to generate a component?
I am going to update the template by tomorrow, to come with working defaults out of the box
This is still an issue with new installations in 2020. Just installed on a brand new instance of Windows 10
Too bad is does not “just run out of the box”. It’s pretty hard to convince co workers to switch to NativeScript with Angular, when we use 1 - 2 working days, just getting a simple tutorial to run… Too much idle time… We may have to use another framework, just because of this hassle. 😦
@sebawita I ran into this issue but then after running"npm i -g @nativescript/schematics" solved the problem but created another issue “Could not find an NgModule. Use the skip-import option to skip importing in NgModule.” when i run “ng g c layout/stack” inside the src folder of my NativeScript Angular App.
@sebawita that works!