Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
NX Angular multiple libs with the same name

So I am using Angular with NX and I have the following groups books and cars. For both groups I want to create an overview lib with a table to view the books or cars.

So I create the lib under libs/books/overview next up I want to do the same for cars libs/cars/overview. But then I run into this issue:

Error: Project name already exists.

Do I need to name the libs like books-overview? Then I would create the following lib: libs/books/books-overview. books is redundant so it doesn't seem like the best option.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

The folder name does not have to be same as the app. Instead, you could create parent folder for each dash separated part of your library name.

You can create lib with name 'books-overview' in folder books/overview.


Running the command with the folder structure as name, it correctly decides on the name. Running

npx ng generate @nrwl/workspace:library --name=books/overview

will generate library 'books-overview' in folder books/overview.


For example this is config of our application (we also use nx):

// angular.json excerpt
"api-java-model": {
  "projectType": "library",
  "root": "libs/api/java/model",
...
},
"api-java-client": {
  "projectType": "library",
  "root": "libs/api/java/client",
...

That way you don't have a folder collision.

over 4 years ago · Santiago Trujillo Denunciar

0

I think the best option here is create a folder overviews with the libs inside. For instance:

libs/overviews/cars

libs/overviews/books

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda