How do I disable the angular caching that occurs in the root of all of the Angular projects? This seemed to start last week when I installed NVM.
2 Answers
Angular now supports the use of persistent build cache by default for new v13 projects.
To disable it you can run below command in your workspace root folder.
ng config cli.cache.enabled false
You can also disabled it by setting the "enabled" flag to "false" in angular.json file
"cli": {
"cache": {
"enabled": false
}
}
Reference:- https://angular.io/cli/cache
2 Comments
Vimal Patel's answer is accurate, but the following command will do the same without having to know the configuration path (documentation).
ng cache disable
However, disabling the build cache will not prevent npm packages in node_modules
from being cached. Not only are packages in node_modules
considered immutable unless the version in package.json
changes, webpack also considers node_modules to be immutable.
1 Comment
node_modules
npm install
. Disabling the CLI cache as per stackoverflow.com/a/70249096/2902555 fixed the issue.