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

NX init not working for Angular 14.2.0 #22971

Closed
1 of 4 tasks
JoepKockelkorn opened this issue Apr 24, 2024 · 3 comments
Closed
1 of 4 tasks

NX init not working for Angular 14.2.0 #22971

JoepKockelkorn opened this issue Apr 24, 2024 · 3 comments
Assignees
Labels
scope: angular Issues related to Angular support in Nx type: bug

Comments

@JoepKockelkorn
Copy link

JoepKockelkorn commented Apr 24, 2024

Current Behavior

When I try to add NX to an existing Angular workspace using npx nx@latest init I run into an infinite nested loop.

Expected Behavior

Adding NX to an existing Angular workspace correctly converts the workspace to an nx workspace.

GitHub Repo

https://github.com/JoepKockelkorn/angular-nx-init-bug

Steps to Reproduce

  1. install correct node version (see .nvmrc)
  2. install dependencies
  3. run npx nx@latest init
  4. Choose 'Skip for now' when prompted with 'Would you like remote caching to make your build faster?'

Nx Report

Node   : 16.13.2
OS     : darwin-arm64
npm    : 8.1.2

nx             : 17.0.5
@nx/js         : 17.0.5
@nx/linter     : 17.0.5
@nx/eslint     : 17.0.5
@nx/workspace  : 17.0.5
@nx/angular    : 17.0.5
@nx/devkit     : 17.0.5
@nrwl/tao      : 17.0.5
@nx/web        : 17.0.5
@nx/webpack    : 17.0.5
typescript     : 4.8.4

Failure Logs

No response

Package Manager Version

8.1.2

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

Probably a workaround is to upgrade Angular to 15 and then try again, because it results in the legacy upgrade branch from being skipped (see this). Will try that out, but wanted to log the bug anyway.

@FrozenPandaz FrozenPandaz added the scope: angular Issues related to Angular support in Nx label Apr 24, 2024
@JoepKockelkorn
Copy link
Author

Can confirm that a successful workaround exists by first upgrading Angular to 15, then trying again.

@leosvelperez
Copy link
Member

Thank you for reporting this!

This was now fixed by releasing Nx 17.0.6.

@JoepKockelkorn
Copy link
Author

Yes, can confirm it works!

npx nx@latest init
Need to install the following packages:
  nx@latest
Ok to proceed? (y)

 NX   🧐 Checking versions compatibility


 NX   💽 Running migration for a legacy Angular version


 NX   🐳 Nx initialization

✔ Would you like remote caching to make your build faster? · skip

 NX   📦 Installing dependencies

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'npm-package-arg@11.0.1',
npm WARN EBADENGINE   required: { node: '^16.14.0 || >=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'hosted-git-info@7.0.1',
npm WARN EBADENGINE   required: { node: '^16.14.0 || >=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'lru-cache@10.2.2',
npm WARN EBADENGINE   required: { node: '14 || >=16.14' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }

added 600 packages, removed 3 packages, changed 13 packages, and audited 1506 packages in 11s

177 packages are looking for funding
  run `npm fund` for details

2 high severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

 NX   📝 Setting up workspace


 >  NX   🧐 Checking versions compatibility


 >  NX   ✅ The Angular version is compatible with the latest version of Nx!


 >  NX   🐳 Nx initialization


 >  NX   🧑‍🔧 Please answer the following questions about the targets found in your angular.json in order to generate task runner configuration

✔ Which of the following targets are cacheable? (Produce the same output given the same input, e.g. build, test and lint usually are, serve and start are not) · build

✔ Enable distributed caching to make your CI faster · No

 >  NX   📦 Installing dependencies

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'hosted-git-info@7.0.1',
npm WARN EBADENGINE   required: { node: '^16.14.0 || >=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'lru-cache@10.2.2',
npm WARN EBADENGINE   required: { node: '14 || >=16.14' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'npm-package-arg@11.0.1',
npm WARN EBADENGINE   required: { node: '^16.14.0 || >=18.0.0' },
npm WARN EBADENGINE   current: { node: 'v16.13.2', npm: '8.1.2' }
npm WARN EBADENGINE }

up to date, audited 1506 packages in 912ms

177 packages are looking for funding
  run `npm fund` for details

2 high severity vulnerabilities

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

 >  NX   📝 Setting up workspace


 >  NX   🎉 Done!

   - Enabled computation caching!
   - Execute "npx nx build" twice to see the computation caching in action.
   - Learn more at https://nx.dev/recipes/angular/migration/angular.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
scope: angular Issues related to Angular support in Nx type: bug
Projects
None yet
Development

No branches or pull requests

3 participants