Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

150
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!