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
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
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
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 ERESOLVEnpm ERR! ERESOLVE unable to resolve dependency treenpm ERR!npm ERR! While resolving: iggrid1sch@0.0.0npm ERR! Found: jasmine-core@3.7.1npm ERR! node_modules/jasmine-corenpm ERR! dev jasmine-core@"~3.7.0" from the root projectnpm ERR!npm ERR! Could not resolve dependency:npm ERR! peer jasmine-core@">=3.8" from karma-jasmine-html-reporter@1.7.0npm ERR! node_modules/karma-jasmine-html-reporternpm ERR! dev karma-jasmine-html-reporter@"^1.5.0" from the root projectnpm ERR!npm ERR! Fix the upstream dependency conflict, or retrynpm ERR! this command with --force, or --legacy-peer-depsnpm 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
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.
Sincerely,Teodosia HristodorovaAssociate Software Developer
Thanks Teodosia. All worked out.
I am glad that you find my suggestion helpful.
Thank you for using Infragistics components.
Regards,Teodosia HristodorovaAssociate Software Developer