Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

152
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda