Skip to content

Infragistics Community Forum / Web / Ignite UI for Angular / Angular Schematics error : Collection "@igniteui/angular-schematics" cannot be resolved

Angular Schematics error : Collection "@igniteui/angular-schematics" cannot be resolved

New Discussion
Michael Seidel
Michael Seidel asked on Jul 26, 2021 5:08 AM

Installed : C:\_ng\new_ig1>npm i -g @igniteui/angular-schematics

then run command below, and got the error, any advice why?

ng new igGrid2sch –collection=”@igniteui/angular-schematics” –template=side-nav

Log:

[error] Error: Collection “@igniteui/angular-schematics” cannot be resolved.
at SchematicEngineHost.resolve (C:\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js:75:19)
at SchematicEngineHost._resolveCollectionPath (C:\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js:80:37)
at SchematicEngineHost.createCollectionDescription (C:\node_modules\@angular-devkit\schematics\tools\file-system-engine-host-base.js:118:27)
at SchematicEngine._createCollectionDescription (C:\node_modules\@angular-devkit\schematics\src\engine\engine.js:162:40)
at SchematicEngine.createCollection (C:\node_modules\@angular-devkit\schematics\src\engine\engine.js:155:43)
at NewCommand.getCollection (C:\node_modules\@angular\cli\models\schematic-command.js:143:35)
at NewCommand.initialize (C:\node_modules\@angular\cli\models\schematic-command.js:62:37)
at async NewCommand.validateAndRun (C:\node_modules\@angular\cli\models\command.js:121:22)
at async Object.runCommand (C:\node_modules\@angular\cli\models\command-runner.js:224:24)
at async default_1 (C:\node_modules\@angular\cli\lib\cli\index.js:70:31)

Also what would be the reason to use angular-schematics vs Ignite UI Cli , they seems like do the same..  I did not have problem to create new pj with Ignite UI CLI

Sign In to post a reply

Replies

  • 0
    Teodosia Hristodorova
    Teodosia Hristodorova answered on Jul 20, 2021 1:17 PM
    Hello,
    I have been looking into your question and tested the provided command. On my side, everything seems to work as expected without any exceptions. A discussion that you might consider helpful could be found in our GitHub repository here.
    Additionally, since you are able to successfully create a new project using CLI this could be used as an alternative.
    Regarding your second question I could suggest looking at this topic where is mentioned that Ignite UI CLI is a stand-alone command-line tool for creating and scaffolding applications for a variety of frameworks.
    On the other hand, Ignite UI for Angular Schematics are part of the same project, available as a collection that can be used with the Angular CLI. They offer similar core Ignite UI CLI functionality, but one that`s integrated with the Schematics workflow and focused specifically on this product. The schematics collection is added to your project when you install Ignite UI for Angular.
    Both versions of the tooling allow for generating different projects, component and scenario views (templates).
    In addition, a useful guide could be found here.
    Let me know if I may be of any further assistance.

    Sincerely,
    Teodosia Hristodorova
    Associate Software Developer
    • 0
      Michael Seidel
      Michael Seidel answered on Jul 20, 2021 2:35 PM

      Still, what could be potential reasons for the angular schematics giving the error while it was installed.

      If there are ways to check the settings.. the log file not very helpful.

      [error] Error: Collection "@igniteui/angular-schematics" cannot be resolved

      • 0
        Teodosia Hristodorova
        Teodosia Hristodorova answered on Jul 21, 2021 1:03 PM
        Hello,
        After looking at the provided log, I could say that it is thrown at C:\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js. In case C:\ is not your global npm folder, which could be checked by running, the 'npm config get prefix' commandthis could be a possible cause for issues. If this is not the case, what I could say is that once the @igniteui/angular-schematics package is installed globally the 'ng new’, which is part of the Angular framework, should be able to find it and any issues related to it should be addressed to Angular support.
        Let me know if I may be of any further assistance.
        Sincerely,
        Teodosia Hristodorova
        Associate Software Developer
      • 0
        Michael Seidel
        Michael Seidel answered on Jul 21, 2021 1:55 PM

        Let's try again to see what is the problem.. I did the following, got the same result : 

        C:\_ng>npm i -g @igniteui/angular-schematics

        > @igniteui/angular-schematics@12.0.803 preuninstall C:\Users\gkheysin\AppData\Roaming\npm\node_modules\@igniteui\angular-schematics
        > node ./scripts/uninstall.js

        > @igniteui/angular-schematics@12.0.803 postinstall C:\Users\gkheysin\AppData\Roaming\npm\node_modules\@igniteui\angular-schematics
        > node ./scripts/install.js

        + @igniteui/angular-schematics@12.0.803
        updated 1 package in 20.252s

        C:\_ng>cd new_ig1

        C:\_ng\new_ig1>ng new –collection="@igniteui/angular-schematics"
        An unhandled exception occurred: Collection "@igniteui/angular-schematics" cannot be resolved.
        See "C:\Users\gkheysin\AppData\Local\Temp\1\ng-LsQndG\angular-errors.log" for further details.

        then I've run 

        C:\_ng\new_ig1>npm config get prefix
        C:\Users\gkheysin\AppData\Roaming\npm

        and check the contents, there is no \@angular-devkit.

        It seems that I do trying to install  @igniteui/angular-schematics globally.. do you see anything wrong with the sequence or what else could be a potential source of the problem? 

        I also did search through the whole c: drive for node-module-engine-host.js 

        It is located in the following global folder for npm : 

        C:\Users\gkheysin\AppData\Roaming\npm\node_modules\@igniteui\angular-schematics\node_modules\@angular-devkit\schematics\tools

        Could it  be that folder structure is the reason for error ? 

      • 0
        Teodosia Hristodorova
        Teodosia Hristodorova answered on Jul 22, 2021 11:58 AM

        Hello,

        I tested the exact same steps on my side and there is no exception. In addition, the prefix looks correct, and I do not think the reason could be there. Based on the previously provided error log, I assume that there is a node_modules foldеr in C:\, which should not be there. It could be generated when angular cli is installed in case the -g option was missed or due to some other reasons, however, it should not be there since this could lead to errors like the one you are facing.

        Could try to execute these steps in some other drive like D:\ for example and test if there everything works as expected.

        Let me know if I may be of any further assistance.

        Sincerely,

        Teodosia Hristodorova

        Associate Software Developer

      • 0
        Michael Seidel
        Michael Seidel answered on Jul 22, 2021 2:05 PM

        Hi Teodosia,

        Firstly thanks for advice … I checked c:\ root and actually found there node_modules folder.. remove it with all contents and now ng new –collection="@igniteui/angular-schematics"  started to work.. 

        while going through the process it gave me one warning ( what it is about ? ) : 

        "SchematicsAngularComponent" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.

        and then failed with the following : 

        Installing packages (npm)…npm ERR! code ERESOLVE
        npm ERR! ERESOLVE unable to resolve dependency tree
        npm ERR!
        npm ERR! While resolving: iggrid1sch@0.0.0
        npm ERR! Found: jasmine-core@3.7.1
        npm ERR! node_modules/jasmine-core
        npm ERR! dev jasmine-core@"~3.7.0" from the root project
        npm ERR!
        npm ERR! Could not resolve dependency:
        npm ERR! peer jasmine-core@">=3.8" from karma-jasmine-html-reporter@1.7.0
        npm ERR! node_modules/karma-jasmine-html-reporter
        npm ERR! dev karma-jasmine-html-reporter@"^1.5.0" from the root project
        npm ERR!
        npm ERR! Fix the upstream dependency conflict, or retry
        npm ERR! this command with –force, or –legacy-peer-deps
        npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
        npm ERR!
        npm ERR! See C:\Users\gkheysin\AppData\Local\npm-cache\eresolve-report.txt for a full report.

        npm ERR! A complete log of this run can be found in:
        npm ERR! C:\Users\gkheysin\AppData\Local\npm-cache\_logs\2021-07-22T13_54_01_654Z-debug.log
        × Package install failed, see above.
        The Schematic workflow failed. See above.

        How to address the issue and may be I should verify if I have the latest schematics version, how to do it ?

        Thnx

      • 0
        Teodosia Hristodorova
        Teodosia Hristodorova answered on Jul 23, 2021 1:07 PM

        Hello,


        I'm assuming this error occurs when 'npm i' is called and as it is pointed out into the error log the problem is jasmine-core and karma-jasmine-html-reporter version is throwing an error. So the solution could be to change the version of “jasmine-core” 3.7.0 to 3.8.0 and “karma-jasmine-html-reporter” from 1.5.0 to 1.7.0.


        This could be done by opening the folder you create with ng new and go to the package.json file. In devDependencies change the version of "jasmine-core" and "karma-jasmine-html-reporter" and save it. Then go back to Terminal and go to your project and try to run npm install. More about the latest version of jasmine-core and karma-jasmine-html-reporter here and here.


        After an investigation, I determined that the issue came from the Angular template and there is already logged and fixed issue in their GitHub repository here. We will also fix this into the next release and meanwhile please try the suggested steps above.


        Also, please make sure that the node.js version is the LTS version which currently is v14.


        If this does not help I would suggest trying to run 'npm install –legacy-peer-deps' as it is suggested in the error log.


        Let me know if I may be of any further assistance.


        Sincerely,
        Teodosia Hristodorova
        Associate Software Developer

      • 0
        Michael Seidel
        Michael Seidel answered on Jul 23, 2021 6:20 PM

        Thanks Teodosia. All worked out. 

      • 0
        Teodosia Hristodorova
        Teodosia Hristodorova answered on Jul 26, 2021 5:08 AM

        Hello,


        I am glad that you find my suggestion helpful.


        Thank you for using Infragistics components.


        Regards,
        Teodosia Hristodorova
        Associate Software Developer

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Michael Seidel
Favorites
0
Replies
9
Created On
Jul 26, 2021
Last Post
4 years, 7 months ago

Suggested Discussions

Created by

Created on

Jul 26, 2021 5:08 AM

Last activity on

Feb 23, 2026 6:37 AM