Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Schematic "library" not found in collection "@schematics/angular"

I'm getting the following error when trying to create a library in angular cli

Schematic "library" not found in collection "@schematics/angular".
Error: Schematic "library" not found in collection
"@schematics/angular".
    at SchematicEngine.createSchematic (/home/rafaelvicio/node-v8.9.3-linux-x64/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/src/engine/engine.js:143:23)
    at CollectionImpl.createSchematic (/home/rafaelvicio/node-v8.9.3-linux-x64/lib/node_modules/@angular/cli/node_modules/@angular-devkit/schematics/src/engine/collection.js:12:29)
    at Object.getSchematic (/home/rafaelvicio/node-v8.9.3-linux-x64/lib/node_modules/@angular/cli/utilities/schematics.js:47:23)
    at Class.run (/home/rafaelvicio/node-v8.9.3-linux-x64/lib/node_modules/@angular/cli/tasks/schematic-get-options.js:12:40)
    at Class.beforeRun (/home/rafaelvicio/node-v8.9.3-linux-x64/lib/node_modules/@angular/cli/commands/generate.js:101:31)
    at Promise.resolve.then (/home/rafaelvicio/node-v8.9.3-linux-x64/lib/node_modules/@angular/cli/ember-cli/lib/cli/cli.js:138:24)
    at <anonymous>

Command ng --version

shows this

Angular CLI: 1.7.4
Node: 8.9.3
OS: linux x64
Angular: 


node -v
v8.9.3

npm -v
5.5.1
like image 868
Rafael Augusto Avatar asked Apr 20 '18 17:04

Rafael Augusto


People also ask

What is Drang and drop schematic in angular?

Drang and drop schematic is a part of @angular/cdk, this schematic generates an angular component that uses CDK drag and drop directives. Generally, you need to follow below steps to manually install and configure the clarity design system as mentioned in get started. package.

What version of node is used with angular CLI?

Angular CLI: 1.7.4 Node: 8.9.3 OS: linux x64 Angular: node -v v8.9.3 npm -v 5.5.1 Show activity on this post.

What is the use of ngrx schematics?

NgRx Schematics gives commands to generate Store, Action, Reducer, Container, Effect, Entity and Feature. For example, following command generates the action with given ActionName. NgRx Schematics installation is a little different than the above libraries.


2 Answers

npm i -g @schematics/angular 

updates you to the latest version of the schematic. Also important to update your angular cli:

npm i -g @angular/cli
like image 69
DonDaniel Avatar answered Oct 09 '22 06:10

DonDaniel


This worked for me:

npm i @schematics/angular

like image 45
Joshua Craven Avatar answered Oct 09 '22 06:10

Joshua Craven