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.

nx g @nrwl/angular:lib command fails with error

See original GitHub issue

Please make sure you have read the submission guidelines before posting an issue

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • I am running the latest version - @angular/cli": “~9.1.5” and “@nrwl/angular”: “9.2.4”
  • I checked the documentation (nx.dev) 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 React, Angular or any dependency)

Expected Behavior

The following command should generate an nx library nx g @nrwl/angular:lib --directory=common --dry-run --lazy --name=core --no-interactive --routing --parent-module=apps/medsoft/src/app/app.module.ts --prefix=core --simpleModuleName --style=scss --tags=core

Current Behavior

The above command fails

Failure Information (for bugs)

Executing task: ng generate @nrwl/angular:library --name=core --no-interactive --dry-run <

Path “/libs/core/src/lib/core.service.spec.ts” does not exist.

Terminal will be reused by tasks, press any key to close it.

See attached file nx

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  1. step 1 Open an nx application folder with Visual Studio code

  2. step 2 Click the nx icon and chose generate form the nx menu

  3. … Click @nrwl/angular:library and add the name core

  4. … Watch the VSCode terminal - the error is shown in red

If you can provide steps to reproduce from scratch, that would be enormously appreciated (i.e. where the first step is npx create-nx-workspace@latest repro-workspace)

Context

Please provide any relevant information about your setup:

A minimal reproduction scenario allows us to quickly confirm a bug (or point out coding problem) as well as confirm that we are fixing the right problem.

Failure Logs

None

Other

Removed and reinstall global and local cache with the same result. OS windows 10 x64 node v13.3.0 npm 6.13.1

Identical error generated on MacBook

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
loic49commented, Jan 10, 2021

I don’t know if it can help but I’d got the same error (error to create service)…and solve it.

My workspace wasn’ first a nx workspace I migrate it with “Using ng add and preserving your existing structure”. After migration, I had in my angular.json this entry : “newProjectRoot”: "projects. After I delete it my previous error to generate a library disapear.

Hope it helps.

0reactions
Benja1512commented, Nov 23, 2022

npx generate @nrwl/angular:library --name=products --style=scss --no-interactive --dry-run

Read more comments on GitHub >

github_iconTop Results From Across the Web

angularjs - zsh: command not found: nx - Stack Overflow
I am trying to create a library in Angular using nx g @nrwl/angular:lib shared but it keep giving me error zsh: command not...
Read more >
3 - Generating components and Nx lib - Angular and NgRx
Run the below command to see all the lib options. nx g lib --help. The output for the current Nx version ... nx...
Read more >
nrwl-nx/community - Gitter
... errors: NX ERROR Running target "test" for affected projects failed . ... But I don't know what thing should I put into...
Read more >
Releasing packages - nxpm
nx g @nrwl/angular:lib web-core --style scss --publishable ... Initially, the command will fail with some errors: Copy. NXPM VALIDATE Using nx workspace: ...
Read more >
[Tech Blog] Introduction to NX and Monorepos - AnyMind Group
Nx is a framework that allows you to architect, test, and build your project at any scale with ... npx nx g @nrwl/angular:lib...
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