question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

angular.json missing from new workspace (react) - causes error runing NG

See original GitHub issue
  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I’m reporting the issue to the correct repository (not related to Angular, AngularCLI or any dependency)

Expected Behavior

To be able to add applications to a newly created workspace.

Current Behavior

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

Failure Information (for bugs)

➜  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

Steps to Reproduce

See above for steps.

Context

Please provide any relevant information about your setup:

  • version of Nx latest
  • version of Angular CLI latest
  • angular.json configuration ITS MISSING

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:6

github_iconTop GitHub Comments

3reactions
vsavkincommented, Aug 6, 2019

@appsolutegeek

8.4+ supports two CLIs: Angular CLI and Nx CLI. It works as follows:

  • if you select an empty preset, you have to select the CLI
  • if you select a preset with an angular app, you get the angular cli
  • if you select a preset without an angular app, you get the nx cli

I tried to make this process clearer in 8.4.3. Could you give it a try to see if it’s transparent enough?

1reaction
iangregsondevcommented, Jul 28, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Local workspace file ('angular.json') could not be found
New configuration format. The new file can be found at angular.json (but .angular.json is also accepted). Running ng update on a CLI 1.7 ......
Read more >
Router tutorial: tour of heroes - Angular
From your terminal, navigate to the angular-router-tour-of-heroes directory. Verify that your new application runs as expected by running the ng serve command.
Read more >
Security - Angular
This topic describes Angular's built-in protections against common web-application vulnerabilities and attacks such as cross-site scripting attacks.
Read more >
Service worker in production - Angular
Whenever a new build of the application is deployed, the service worker treats that ... An unrelated error causes the service worker to...
Read more >
Schematics for libraries - Angular
In your library project's package.json file, add a "schematics" entry with the path to your schema file. The Angular CLI uses this entry...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found