Questions tagged [nrwl-nx]

Nx is an open source, next generation build system with first class monorepo support and powerful integrations.

Nx - Smart, Fast and Extensible Build System

Nx is an open source, next generation build system with first-class monorepo support and powerful integrations. It helps you architect, test, and build at any scale, integrating seamlessly with modern technologies and libraries while providing a robust CLI, caching, dependency management, and more.

Nx comes with a set of plugins for TypeScript, Angular, React, Node, Storybook, Cypress, Jest, and more, maintained by the Nx core team and a huge set of community provided extensions.

Find out more on nx.dev and on GitHub.

807 questions
70
votes
5 answers

How to clear Nx cache

I have an Nx monorepo (https://nx.dev). It has a folder with Nx cache (./node_modules/.cache/nx/). Its size for now is over 3GB. Is there a command for clear this cache?
Pax Beach
  • 2,059
  • 1
  • 20
  • 27
55
votes
1 answer

the difference between nx and Lerna ? (monorepos)

hello i'm in new in monorepos world and i'm now searching about different monorepos tools and i found two intersting tools Nx(nrwl) and lerna but i didn't understand the real differnce between these two tools so any help and thanks
anis khalfaoui
  • 779
  • 1
  • 6
  • 12
31
votes
10 answers

Add Angular Material to Nx Workspace

I'm wanting to add angular-material to my nx-workspace. The angular material docs (https://material.angular.io/guide/getting-started) say I should run ng add @angular/material. I've tried that in the root of my nx workspace, as well as in an…
vicatcu
  • 5,407
  • 7
  • 41
  • 65
24
votes
6 answers

'nx' is not recognized as the name of a cmdlet

I am trying to add a new util library into my Nx mono repo. I googled and found the following command from www.nx.dev: nx generate @nrwl/nest:library util/util-myLibName When I run the above command, then I get the following message: The term 'nx'…
Mohsen
  • 971
  • 2
  • 11
  • 29
21
votes
1 answer

Angular Nx Nrwl - Cannot parse tsconfig.base.json: PropertyNameExpected in JSON when try to create a new lib

Im getting this error Cannot parse tsconfig.base.json: PropertyNameExpected in JSON at position 891 when i run nx g @nrwl\angular:lib libName on CLI my tsconfig.base.json { "compileOnSave": false, "compilerOptions": { "rootDir": ".", …
Luis Fernando
  • 1,146
  • 8
  • 21
17
votes
1 answer

Module Federation Shared Services

I'm working on a new project using Angular 11 and Webpack 5. I am basing my work on Manfred Steyer's Module Federation Plugin Example repo, which uses Angular CLI. I can't figure out how to share a singleton service from a shared local Angular…
Mike
  • 1,266
  • 1
  • 11
  • 17
17
votes
2 answers

How can I get the previous commit before a push or merge in GitHub Action workflow?

I'm using Nx for monorepo support on a new project. One of the benefits of Nx is that it can determine which apps in the monorepo are affected by a range of changes (start commit, end commit). So if you have a bunch of apps, you only have to build,…
Rich McCluskey
  • 1,871
  • 2
  • 18
  • 30
17
votes
3 answers

Generate package.json on nx build / deployment

I've a monorepo using nx with multiple node/nestjs apps. Some of the apps doesn't require all the packages used in the other apps. Because it's a monorepo, I need to install all packages for every apps during the deployment. Is there a way generate…
N0Cloud
  • 201
  • 1
  • 2
  • 6
17
votes
6 answers

NRWL NX importing lib error TS2307: Cannot find module '@eduboard/interfaces'

I've just created a new NX project for work and I've created a lib for out interfaces to have them on the backend and the front end. I'm getting this error when I compile apps/askeddi/src/app/pages/global-admin/global-admin.component.ts(5,38): error…
Skel
  • 1,611
  • 3
  • 16
  • 36
16
votes
6 answers

Global Type Declarations within a NX and NextJS monorepo

I've been looking around the web to try and find s nice solution to my problem but so far I have not. I have a NX monorepo with NextJS and I am trying to create a global types/ folder that can be used by all of my apps and libs. I had thought this…
lukehillonline
  • 2,430
  • 2
  • 32
  • 48
16
votes
1 answer

NX workspace, how to change an Angular app name with the the cli?

I have NX workspace with some apps and the product decided to change one of the apps name, how can I do it without manually change the app's folders names, modules names, all the importing paths, NX settings etc'? Same app, same location, only…
Elad
  • 2,087
  • 1
  • 16
  • 30
16
votes
6 answers

process.env.NODE_ENV always 'development' when building nestjs app with nrwl nx

My NX application's npm run build:server calls ng build api-server that triggers the @nrwl/node:build builder. It builds the NestJS application as main.js. Things work except I wanted process.env.NODE_ENV to be evaluated at runtime but I think it…
kctang
  • 10,894
  • 8
  • 44
  • 63
15
votes
0 answers

How to pass arguments to eslint when using nx lint

I want to use eslint arguments such as --no-error-on-unmatched-pattern. https://eslint.org/docs/user-guide/command-line-interface#options However, when using nx lint/nx run-many --all --target=lint/nx affected:lint - these arguments don't appear to…
Adam Marshall
  • 3,010
  • 9
  • 42
  • 80
15
votes
1 answer

Providing typescript declaration file for external lib with Nx

This question has been asked and answered many different ways on Stack overflow and I think I've tried them all. This question is specific to getting it to work using @nrwl/nx. The specific error is TS7016: Could not find a declaration file for…
Jeff
  • 939
  • 10
  • 19
15
votes
1 answer

Is it possible to use different apps as git submodules in a nx workspace?

I want to build a nestjs backend which is used by a angular frontend application. Each of them for now in a single repository. I stumbled over nrwl-nx for monorepo tooling and am really intrigued to use it. But my question now is: is it possible to…
Hüftl
  • 211
  • 2
  • 12
1
2 3
53 54