nx: Error when trying to generate new lib

I am unable to generate anything new in my work space. When I try to create a new lib I get the following error

Error: Unregistered task "node-package" in schematic "lib".
Unregistered task "node-package" in schematic "lib".

generating components results in the following Schematic "c" not found in collection "@nrwl/schematics".

I have tried deleting and reinstalling everything but its not working and I cant find any similar errors when searching google

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 19 (3 by maintainers)

Most upvoted comments

created a patch in my code-gen script to resolve the failing of the component creation

function patchSchema() {
  const schemaPath = `${rootRepo}/node_modules/@schematics/angular/component/schema.json`;
  const exist = fs.existsSync(schemaPath);
  if (!exist)
    return;
  const content = fs.readFileSync(schemaPath, 'utf-8');

  const schemaFile = JSON.parse(content);
  schemaFile.properties.changeDetection.alias = 'cd';

  fs.writeFileSync(schemaPath, JSON.stringify(schemaFile));

}