Angular CLI allows you to create a new workspace without generating an initial application. Then you need to create a new application within the workspace. For more details, please read ‘A Step-By-Step Guide To Angular Workspaces, Applications, And Components.‘
When attempting to install NgRx, you may encounter the following error.
$ npx ng add @ngrx/store
ℹ Using package manager: npm
✔ Found compatible package version: @ngrx/store@16.3.0.
✔ Package information loaded.
The package @ngrx/store@16.3.0 will be installed and executed.
Would you like to proceed? Yes
✔ Packages successfully installed.
Specified module path /projects/ng-rx/app does not exist
How to reproduce it
Use the cd command to navigate into the application folder.
cd path/<app_name>
Open Terminal and run the following command:
npx ng add @ngrx/store
Solution
To fix this issue, you can use the following command:
npx ng add @ngrx/store --path projects/<app_name>/src
or
npx ng add @ngrx/store --path projects/<app_name>/src --no-minimal
NgRx Effects installation
npx ng add @ngrx/effects --path projects/<app_name>/src