Skip to content

yarn add ngx-build-plus not working #407

@simonebosio91

Description

@simonebosio91

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:

  • Node.js version: 20.15.0 (managed via nvm)
  • Yarn version: 1.22.22
  • Angular CLI version: 18.0.6

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions