manfredsteyer / ngx-build-plus

Extend the Angular CLI's default build behavior without ejecting, e. g. for Angular Elements
1.19k stars 136 forks source link

yarn add ngx-build-plus not working #407

Open simonebosio91 opened 3 weeks ago

simonebosio91 commented 3 weeks ago

Description:

I encountered an issue when trying to add ngx-build-plus to my project using Yarn. The installation fails with the following error:

Invariant Violation: could not find a copy of vite to link in C:\GIT\ZeroD\_GitHub\ZD_ClientUnico\node_modules\ngx-build-plus\node_modules\@angular-devkit\build-angular\node_modules
    at invariant (C:\Users\WUSIMBOS\AppData\Roaming\nvm\v20.15.0\node_modules\yarn\lib\cli.js:2318:15)
    at PackageLinker.<anonymous> (C:\Users\WUSIMBOS\AppData\Roaming\nvm\v20.15.0\node_modules\yarn\lib\cli.js:48524:7)
    at Generator.next (<anonymous>)
    at step (C:\Users\WUSIMBOS\AppData\Roaming\nvm\v20.15.0\node_modules\yarn\lib\cli.js:310:30)
    at C:\Users\WUSIMBOS\AppData\Roaming\nvm\v20.15.0\node_modules\yarn\lib\cli.js:321:13
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Steps to Reproduce:

  1. Run yarn add ngx-build-plus in a project that includes Angular.
  2. Observe the error message during the installation process.

Environment:

Expected Behavior:

ngx-build-plus should be installed without errors.

Actual Behavior:

The installation fails with an "Invariant Violation" error, indicating that a copy of vite could not be found.

Additional Context:

This issue might be related to dependency resolution or conflicts within the node_modules structure, particularly involving vite. Attempts to clean node_modules, reinstall dependencies, and force resolutions have not resolved the issue.

mguay22 commented 3 weeks ago

Encountering the same issue here.

"ngx-build-plus": "^17.0.0"

error An unexpected error occurred: "could not find a copy of vite to link in /home/mguay//ui/node_modules/ngx-build-plus/node_modules/@angular-devkit/build-angular/node_modules".