Search code examples
angularangular-componentsnx.dev

Unable to resolve @nrwl/angular


Getting below error when I'm trying to create a component in my angular application.

Command

ng generate  component  <component-name>

Error

Unable to resolve @nrwl/angular:component. Cannot find generator 'component' in D:\web-application\node_modules\@nrwl\angular\collection.json.

Has anyone encountered that.?

Below are the details of versions.

Angular CLI: 13.1.2
Node: 16.13.2

Solution

  • One of the solution to overcome from this error is add old schematics vesion in package.json and try to create the component.

    • Current schematics version is @schematics/angular 13.1.2

    • Update to below one

        "devDependencies": {
            "@schematics/angular": "11.2.19"
             - -
             - -
      

      }

    Hope this will be helpfull to someone.

    Thanks.