Is it possible to run n…

less than 1 minute read

Is it possible to run ng add schematics if I’ve generated a new project with the Nx CLI? I’ve tried nx add @angular/material but no dice. For context, I generated my workspace and chose Empty Workspace, with NX CLI, then later added Angular projects

Responses:

At the moment the most reliable way is to add the dependency and then run nx generate @angular/material:init.

So if you use NPM, npm install @angular/material && nx generate @angular/material:init.

Slight nitpick but I think it should be npm install –save or if you use yarn then yarn add

I don’t think --save is necessary with modern version of NPM, but it would be good to add just to be safe. But yes, yarn add ... otherwise.

Ah good to know. I have never actually used npm for more than install deps of someone else project!

I’m not sure many people used npm install without --save so it makes sense :sweat_smile:

Updated: