mardi 1 décembre 2020

can't install jest with Angular 11

I'm trying to use jest for testing Angular 11 app .

My current Angular version :

Angular CLI: 11.0.2
Node: 12.16.2
OS: win32 x64

Angular: 11.0.2
... animations, cli, common, compiler, compiler-cli, core, forms
... platform-browser, platform-browser-dynamic, router
Ivy Workspace: Yes

Package                         Version
---------------------------------------------------------
@angular-devkit/architect       0.1100.2
@angular-devkit/build-angular   0.1100.2
@angular-devkit/core            11.0.2
@angular-devkit/schematics      11.0.2
@schematics/angular             11.0.2
@schematics/update              0.1100.2
rxjs                            6.6.3
typescript                      4.0.5

I launched :

npm install -g @briebug/jest-schematic

and inside my angular app i launched :

ng g @briebug/jest-schematic:add

I got this error :

An unhandled exception occurred: Collection "@briebug/jest-schematic" cannot be resolved. See "C:\Users\bouss\AppData\Local\Temp\ng-vB4LT1\angular-errors.log" for further details.

The log file content :

[error] Error: Collection "@briebug/jest-schematic" cannot be resolved.
    at NodeModulesEngineHost.resolve (D:\2021\angular-test\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js:75:19)
    at NodeModulesEngineHost._resolveCollectionPath (D:\2021\angular-test\node_modules\@angular-devkit\schematics\tools\node-module-engine-host.js:80:37)
    at NodeModulesEngineHost.createCollectionDescription (D:\2021\angular-test\node_modules\@angular-devkit\schematics\tools\file-system-engine-host-base.js:110:27)
    at SchematicEngine._createCollectionDescription (D:\2021\angular-test\node_modules\@angular-devkit\schematics\src\engine\engine.js:148:40)
    at SchematicEngine.createCollection (D:\2021\angular-test\node_modules\@angular-devkit\schematics\src\engine\engine.js:141:43)
    at GenerateCommand.getCollection (D:\2021\angular-test\node_modules\@angular\cli\models\schematic-command.js:126:35)
    at GenerateCommand.initialize (D:\2021\angular-test\node_modules\@angular\cli\models\schematic-command.js:42:37)
    at async GenerateCommand.initialize (D:\2021\angular-test\node_modules\@angular\cli\commands\generate-impl.js:13:9)
    at async GenerateCommand.validateAndRun (D:\2021\angular-test\node_modules\@angular\cli\models\command.js:124:9)
    at async Object.runCommand (D:\2021\angular-test\node_modules\@angular\cli\models\command-runner.js:204:24)

Aucun commentaire:

Enregistrer un commentaire