nx-plus icon indicating copy to clipboard operation
nx-plus copied to clipboard

ERESOLVE unable to resolve dependency tree

Open nathandaly opened this issue 4 years ago • 4 comments

Current Behavior

nx g @nx-plus/nuxt:app my-app
⠼ Installing packages (npm)...npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @typescript-eslint/[email protected]
npm ERR! node_modules/@typescript-eslint/parser
npm ERR!   dev @typescript-eslint/parser@"4.19.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @typescript-eslint/parser@"~4.28.3" from @nrwl/[email protected]
npm ERR! node_modules/@nrwl/eslint-plugin-nx
npm ERR!   dev @nrwl/eslint-plugin-nx@"12.6.2" 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/nathan/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/nathan/.npm/_logs/2021-07-24T17_27_59_149Z-debug.log
✖ Package install failed, see above.
UnsuccessfulWorkflowExecution [Error]: Workflow did not execute successfully.
    at ChildProcess.<anonymous> (/Users/nathan/Projects/Nathan/Web/test-pp/node_modules/@angular-devkit/schematics/tasks/package-manager/executor.js:112:31)
    at ChildProcess.emit (node:events:394:28)
    at maybeClose (node:internal/child_process:1067:16)
    at Socket.<anonymous> (node:internal/child_process:453:11)
    at Socket.emit (node:events:394:28)
    at Pipe.<anonymous> (node:net:672:12)
The generator workflow failed. See above.

Expected Behavior

No error with Nuxt support added to the the blank NX workspace.

Steps to Reproduce

npx create-nx-workspace@^12.0.0
cd test-pp/
npm install @nrwl/cypress@^12.0.0 @nrwl/jest@^12.0.0 @nrwl/linter@^12.0.0 --save-dev
npm install @nx-plus/nuxt --save-dev
nx g @nx-plus/nuxt:app my-app

Environment

  Node : 16.5.0
  OS   : darwin x64
  npm  : 7.20.1

  nx : Not Found
  @nrwl/angular : Not Found
  @nrwl/cli : 12.6.2
  @nrwl/cypress : 12.6.2
  @nrwl/devkit : 12.6.2
  @nrwl/eslint-plugin-nx : Not Found
  @nrwl/express : Not Found
  @nrwl/jest : 12.6.2
  @nrwl/linter : 12.6.2
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : Not Found
  @nrwl/nx-cloud : Not Found
  @nrwl/react : Not Found
  @nrwl/schematics : Not Found
  @nrwl/tao : 12.6.2
  @nrwl/web : Not Found
  @nrwl/workspace : 12.6.2
  @nrwl/storybook : Not Found
  @nrwl/gatsby : Not Found
  typescript : 4.3.5

nathandaly avatar Jul 24 '21 17:07 nathandaly

Thanks for reporting this!

This is a bit of a hairy issue related to how npm 7 handles peer dependencies.

There are a couple of workarounds. One, use npm <7. I would recommend this. Two, run npm install --legacy-peer-deps after getting the reported error. I wouldn't recommend this for the reason noted in the error message.

I'm leaving this open as we expect to support npm >=7.

BuckyMaler avatar Jul 24 '21 19:07 BuckyMaler

@BuckyMaler Firstly, thank you for the super fast reply.

Cheers for the tips, tbh I didn't know that about npm 7. Will try downgrading it Following on from twitter status 👍

nathandaly avatar Jul 24 '21 21:07 nathandaly

You're welcome!

Also, be aware I came across a separate issue #190 while testing this. I've linked a workaround in that issue.

We'll try to replace these workarounds with fixes soon.

BuckyMaler avatar Jul 24 '21 21:07 BuckyMaler

Just leading on from this. I had to use --force on top of --legacy-peer-deps as it REALLY didn't want resolve anything.

❯ npm install --legacy-pee-deps
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @typescript-eslint/[email protected]
npm ERR! node_modules/@typescript-eslint/parser
npm ERR!   dev @typescript-eslint/parser@"4.19.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @typescript-eslint/parser@"~4.28.3" from @nrwl/[email protected]
npm ERR! node_modules/@nrwl/eslint-plugin-nx
npm ERR!   dev @nrwl/eslint-plugin-nx@"12.6.2" 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/nathandaly/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/nathandaly/.npm/_logs/2021-07-25T09_11_53_107Z-debug.log

nathandaly avatar Jul 25 '21 09:07 nathandaly