bennymeg / nx-electron

Electron schematics for nrwl nx platform
Apache License 2.0
307 stars 82 forks source link

Update to Support Nx 19 #293

Open cliftonlabrum opened 4 weeks ago

cliftonlabrum commented 4 weeks ago

When I run:

npm install -D nx-electron

...in my Nx 19.2.2 project, I get a dependency conflict:

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: @myproject/source@0.0.0
npm error Found: @nx/workspace@19.2.2
npm error node_modules/@nx/workspace
npm error   dev @nx/workspace@"19.2.2" from the root project
npm error
npm error Could not resolve dependency:
npm error peer @nx/workspace@"^18" from nx-electron@18.0.1
npm error node_modules/nx-electron
npm error   dev nx-electron@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.

Any chance you can update this package to support the latest version of Nx? Or is there a workaround I'm not familiar with? I'm new to Nx. 😊

fhemery commented 3 weeks ago

While waiting for the update, it seems like you can temporarily overload the dependency in your package.json:

"overrides": {
    "nx-electron": {
      "@nx/workspace": "19.2.2" // Or whatever version you are using.
    }
  },

I managed to generate a working app this way 😄.

@bennymeg I am not very familiar with NX schematics system and thus don't know if the update is just above bumping dependencies. Feel free to let me know if you feel like it's easy enough and want me to submit a PR.

bennymeg commented 2 weeks ago

@fhemery Tnx, I'm, working on it on a separate branch. I wanted to try and add vite support for this version, but I see I won't have a chance. Will release it soon.