To be able to add applications to a newly created workspace.
Following the docs for creating a new workspace and then trying to add a react app. Creating a new workspace DOES NOT create a angular.json file so trying to run NG always fails
➜ typescript npx create-nx-workspace testfinal
npx: installed 166 in 10.678s
? What to create in the new workspace empty [an empty workspace]
Successfully initialized git.
CREATE testfinal/nx.json (202 bytes)
CREATE testfinal/tsconfig.json (509 bytes)
CREATE testfinal/README.md (2541 bytes)
CREATE testfinal/.editorconfig (245 bytes)
CREATE testfinal/.gitignore (503 bytes)
CREATE testfinal/.prettierignore (57 bytes)
CREATE testfinal/.prettierrc (26 bytes)
CREATE testfinal/workspace.json (96 bytes)
CREATE testfinal/package.json (1045 bytes)
CREATE testfinal/apps/.gitkeep (1 bytes)
CREATE testfinal/libs/.gitkeep (0 bytes)
CREATE testfinal/tools/tsconfig.tools.json (218 bytes)
CREATE testfinal/tools/schematics/.gitkeep (0 bytes)
CREATE testfinal/.vscode/extensions.json (109 bytes)
Notice above there is NO angular.json
so... this fails ....
➜ testfinal git:(master) ng add @nrwl/react
The add command requires to be run in an Angular project, but a project definition could not be found.
Also the angular console app fails as well, I think its also becasue the angular.json is missing see
https://github.com/nrwl/angular-console/issues/779
See above for steps.
Please provide any relevant information about your setup:
angular.json configuration ITS MISSINGThe way I got around this was to create an angular app with NX and then i was able to add a react app as the angular.json already exists.
I then removed the angular app from nx.json and also angular.json
Is this the correct workaround ?
Ok, it seems that a react app doesn't create an angular.json but it creates a workspace.json
So all commands now are NX instead of NG.
Do you have a list of a comparison between NX and NG ?
This must be something new :-) ? As I never saw this before.
@appsolutegeek
8.4+ supports two CLIs: Angular CLI and Nx CLI. It works as follows:
I tried to make this process clearer in 8.4.3. Could you give it a try to see if it's transparent enough?
Ok thank you, made a note. Thank you
If I'm using nx cli isn't a way to setup an angular.json ? also Angular Console capabilities are lost
Most helpful comment
@appsolutegeek
8.4+ supports two CLIs: Angular CLI and Nx CLI. It works as follows:
I tried to make this process clearer in 8.4.3. Could you give it a try to see if it's transparent enough?