I work with Angular 7.1.4. I want to generate a new module with the following line;
ng g m order-process
But I encountered an error:
<
Run npm install @schematics/angular@7.0.7 --save-dev
replace version with the same as your @angular/cli
(in this scenario, 7.0.7)
My problem was that my node version was on 8.x.x
but angular >= 8.x.x
requires a node version >= 10.x.x
Im using nvm to change node version. Install it with like so (check link for windows usage)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.2/install.sh | bash
after installation install node version 10.x.x
nvm install 10
then switch in terminal like this
nvm use 10
Deleting existing package-lock.json
and node_modules
directory helped me running the ng new
command without error
Try to generate a blank new project and check if you get the same error there too when creating a module using the CLI.
If you do, then I'd recommend to re-install angular.
Had this issue while using Using: @angular/cli 8.1.1, @angular-devkit/schematics 8.0.1, Node v8.9.4, Upgrading to Node 10 fixed it.
There seems to be an issue with the angular schematics- use npm install --save @angular/pwa@0.6.8
Also you can try lowering the pwa version if you face further issues.
The issue thread on github- https://github.com/angular/angular-cli/issues/11663