How to clear Nx cache
Just delete the whole ‘nx’ cache folder: rm -rf ./node_modules/.cache/nx
Just delete the whole ‘nx’ cache folder: rm -rf ./node_modules/.cache/nx
This worked for me nx test –test-file example.spec.ts
2022 Update As pointed out by my great fellow at the comment section, Lerna is now being held by the Nx team. The best solution nowadays is to use more native approaches for publishing (as NPM/YARN workspaces) or go straight to Nx. Good references: Lerna is dead — Long Live Lerna Integrating Nx and Lerna … Read more
Quick fix 1) Change current directory in cmd/terminal to src/app cd src/app (linux) cd .\src\app\ (windows) 2) Run commands now ng g c myComponent