nrwl / nx

Smart Monorepos · Fast CI
https://nx.dev
MIT License
23.28k stars 2.32k forks source link

nx installs too many things, causing linting and type checking to fail in a large monorepo #8524

Closed NullVoxPopuli closed 2 years ago

NullVoxPopuli commented 2 years ago

Current Behavior

after installing @nrwl/cli, @nrwl/tao, and @nrwl/workspace, may linting and type checking tasks started failing (just running with normal eslint and tsc bins.

Why does @nrwl/workspace install so much stuff I don't need?

In my lockfile:

"@nrwl/workspace@13.4.4":
  version "13.4.4"
  dependencies:
    "@nrwl/cli" "13.4.4"
    "@nrwl/devkit" "13.4.4"
    "@nrwl/jest" "13.4.4"
    "@nrwl/linter" "13.4.4"
    "@parcel/watcher" "2.0.4"
    chalk "4.1.0"
    chokidar "^3.5.1"
    cli-spinners "2.6.1"
    cosmiconfig "^4.0.0"
    dotenv "~10.0.0"
    enquirer "~2.3.6"
    figures "3.2.0"
    flat "^5.0.2"
    fs-extra "^9.1.0"
    glob "7.1.4"
    ignore "^5.0.4"
    minimatch "3.0.4"
    npm-run-path "^4.0.1"
    open "^7.4.2"
    rxjs "^6.5.4"
    semver "7.3.4"
    strip-ansi "6.0.0"
    tmp "~0.2.1"
    tslib "^2.3.0"
    yargs "15.4.1"
    yargs-parser "20.0.0"

I don't need:

If there is a way to block dependencies from being installed, I think that could help :thinking: but it feels hacky.

Expected Behavior

I only want task runners. I delegate linting by package

Steps to Reproduce

Environment

>  NX  Report complete - copy this into the issue template

  Node : 16.13.1
  OS   : linux x64
  npm  : 8.1.2

  nx : 13.4.4
  @nrwl/angular : undefined
  @nrwl/cli : 13.4.4
  @nrwl/cypress : undefined
  @nrwl/devkit : 13.4.4
  @nrwl/eslint-plugin-nx : undefined
  @nrwl/express : undefined
  @nrwl/jest : 13.4.4
  @nrwl/linter : 13.4.4
  @nrwl/nest : undefined
  @nrwl/next : undefined
  @nrwl/node : undefined
  @nrwl/nx-cloud : undefined
  @nrwl/react : undefined
  @nrwl/react-native : undefined
  @nrwl/schematics : undefined
  @nrwl/tao : 13.4.4
  @nrwl/web : undefined
  @nrwl/workspace : 13.4.4
  @nrwl/storybook : undefined
  @nrwl/gatsby : undefined
  typescript : 4.2.4
  rxjs : 6.6.7
  ---------------------------------------
  Community plugins:
FrozenPandaz commented 2 years ago

Hey, we by no means want to bring in any node_modules that we don't have to. Let's work on fixing this.

For parcel and jest, we depend on pieces of them, not the whole thing.

Where are you seeing them brought in? Could you please provide more information like you provided for eslint please?

Unfortunately, typescript is tightly integrated for the code analysis that Nx does so I'm not sure if it's easy to remove that one.

I can take a look at moving eslint to a peer dependency first.

FrozenPandaz commented 2 years ago

I've fixed the issue with eslint being installed https://github.com/nrwl/nx/pull/8552. Please open a new issue for jest with more information. As I said, I think the dependency on typescript is necessary.

github-actions[bot] commented 1 year ago

This issue has been closed for more than 30 days. If this issue is still occuring, please open a new issue with more recent context.