Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails when added to Angular 12 Library Project #62

Closed
fireflysemantics opened this issue Jun 3, 2021 · 4 comments · Fixed by #83
Closed

Fails when added to Angular 12 Library Project #62

fireflysemantics opened this issue Jun 3, 2021 · 4 comments · Fixed by #83

Comments

@fireflysemantics
Copy link

Describe the bug

The package @briebug/[email protected] will be installed and executed.
Would you like to proceed? Yes
✔ Package successfully installed.
"BriebugSchematicsJest" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.
DELETE projects/join/karma.conf.js
DELETE projects/join/src/test.ts
CREATE jest.config.js (180 bytes)
CREATE setup-jest.ts (860 bytes)
CREATE test-config.helper.ts (611 bytes)
CREATE projects/join/jest.config.js (193 bytes)
UPDATE package.json (1090 bytes)
UPDATE angular.json (1002 bytes)
UPDATE projects/join/tsconfig.spec.json (290 bytes)
⠋ Installing packages (npm)...npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: [email protected]
npm ERR! node_modules/jest
npm ERR!   dev jest@"27.0.4" from the root project
npm ERR!   peer jest@">=26" from @angular-builders/[email protected]
npm ERR!   node_modules/@angular-builders/jest
npm ERR!     dev @angular-builders/jest@"12.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer jest@"^26.0.0" from [email protected]
npm ERR! node_modules/@angular-builders/jest/node_modules/jest-preset-angular
npm ERR!   jest-preset-angular@"^8.4.0" from @angular-builders/[email protected]
npm ERR!   node_modules/@angular-builders/jest
npm ERR!     dev @angular-builders/jest@"12.0.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 /Users/oleersoy/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/oleersoy/.npm/_logs/2021-06-03T18_38_15_162Z-debug.log
✖ Package install failed, see above.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new Angular 12 project with --create-application=false
  2. Create a library ... ng g library somelib
  3. Add @briebug/jest-schematic

Expected behavior
It should work

Desktop (please complete the following information):

  • OS: [e.g. Mac, Windows] Mac
  • Node version: [e.g. 8.11.3] v16.2.0
  • NPM or Yarn version [e.g. Yarn 1.3.0] 7.13.0
  • App type [e.g. Angular CLI, Nx Workspace] Workspace
  • Angular version [e.g. @angular/core: "6.0.3"] 12
@abelfubu
Copy link

abelfubu commented Jun 6, 2021

I does work for me with a new angular 12 app
However I am getting this error
image

@fireflysemantics fireflysemantics changed the title Fails when added to Angular 12 Project Fails when added to Angular 12 Library Project Jun 7, 2021
@fireflysemantics
Copy link
Author

I'm trying to run it on a Library project. I changed the title to reflect this. I tried it again just to make sure. This is everything on the console.

Oles-MacBook-Pro:jest oleersoy$ ng new test --create-application=false
CREATE test/README.md (1050 bytes)
CREATE test/.editorconfig (274 bytes)
CREATE test/.gitignore (604 bytes)
CREATE test/angular.json (139 bytes)
CREATE test/package.json (1018 bytes)
CREATE test/tsconfig.json (783 bytes)
✔ Packages installed successfully.
hint: Using 'master' as the name for the initial branch. This default branch name
hint: is subject to change. To configure the initial branch name to use in all
hint: of your new repositories, which will suppress this warning, call:
hint: 
hint: 	git config --global init.defaultBranch <name>
hint: 
hint: Names commonly chosen instead of 'master' are 'main', 'trunk' and
hint: 'development'. The just-created branch can be renamed via this command:
hint: 
hint: 	git branch -m <name>
    Successfully initialized git.
Oles-MacBook-Pro:jest oleersoy$ cd test/
Oles-MacBook-Pro:test oleersoy$ ng g library test
CREATE projects/test/README.md (963 bytes)
CREATE projects/test/karma.conf.js (1425 bytes)
CREATE projects/test/ng-package.json (153 bytes)
CREATE projects/test/package.json (183 bytes)
CREATE projects/test/tsconfig.lib.json (405 bytes)
CREATE projects/test/tsconfig.lib.prod.json (240 bytes)
CREATE projects/test/tsconfig.spec.json (309 bytes)
CREATE projects/test/src/public-api.ts (147 bytes)
CREATE projects/test/src/test.ts (761 bytes)
CREATE projects/test/src/lib/test.module.ts (232 bytes)
CREATE projects/test/src/lib/test.component.spec.ts (612 bytes)
CREATE projects/test/src/lib/test.component.ts (259 bytes)
CREATE projects/test/src/lib/test.service.spec.ts (347 bytes)
CREATE projects/test/src/lib/test.service.ts (133 bytes)
UPDATE angular.json (1119 bytes)
UPDATE package.json (1095 bytes)
UPDATE tsconfig.json (875 bytes)
✔ Packages installed successfully.
Oles-MacBook-Pro:test oleersoy$ ng add @briebug/jest-schematic
ℹ Using package manager: npm
✔ Found compatible package version: @briebug/[email protected].
✔ Package information loaded.
 
The package @briebug/[email protected] will be installed and executed.
Would you like to proceed? Yes
✔ Package successfully installed.
"BriebugSchematicsJest" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.
DELETE projects/test/karma.conf.js
DELETE projects/test/src/test.ts
CREATE jest.config.js (180 bytes)
CREATE setup-jest.ts (860 bytes)
CREATE test-config.helper.ts (611 bytes)
CREATE projects/test/jest.config.js (193 bytes)
UPDATE package.json (1090 bytes)
UPDATE angular.json (1002 bytes)
UPDATE projects/test/tsconfig.spec.json (290 bytes)
⠇ Installing packages (npm)...npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: [email protected]
npm ERR! node_modules/jest
npm ERR!   dev jest@"27.0.4" from the root project
npm ERR!   peer jest@">=26" from @angular-builders/[email protected]
npm ERR!   node_modules/@angular-builders/jest
npm ERR!     dev @angular-builders/jest@"12.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer jest@"^26.0.0" from [email protected]
npm ERR! node_modules/@angular-builders/jest/node_modules/jest-preset-angular
npm ERR!   jest-preset-angular@"^8.4.0" from @angular-builders/[email protected]
npm ERR!   node_modules/@angular-builders/jest
npm ERR!     dev @angular-builders/jest@"12.0.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 /Users/oleersoy/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/oleersoy/.npm/_logs/2021-06-07T18_09_32_082Z-debug.log
✖ Package install failed, see above.
The Schematic workflow failed. See above.

@fireflysemantics
Copy link
Author

Hmmm ... This works now ... Looks like it fixed itself ...

The package @briebug/[email protected] will be installed and executed.
Would you like to proceed? Yes
✔ Package successfully installed.
"BriebugSchematicsJest" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.
DELETE projects/fs-time-buckets/karma.conf.js
DELETE projects/fs-time-buckets/src/test.ts
CREATE jest.config.js (180 bytes)
CREATE setup-jest.ts (860 bytes)
CREATE test-config.helper.ts (611 bytes)
CREATE projects/fs-time-buckets/jest.config.js (204 bytes)
UPDATE package.json (1098 bytes)
UPDATE angular.json (1090 bytes)
UPDATE projects/fs-time-buckets/tsconfig.spec.json (290 bytes)
✔ Packages installed successfully.

@melroy89
Copy link

Again, now with Angular v16: #151

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants