nx g @nrwl/angular:lib command fails with error
See original GitHub issuePlease 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
Steps to Reproduce
Please provide detailed steps for reproducing the issue.
-
step 1 Open an nx application folder with Visual Studio code
-
step 2 Click the nx icon and chose generate form the nx menu
-
… Click @nrwl/angular:library and add the name core
-
… 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:
-
version of Nx used (Please run
nx report
at the root of your workspace and copy the results here if you are using Nx 8.6.1 or greater) @nrwl/angular : 9.2.4 @nrwl/cli : 9.2.4 @nrwl/cypress : 9.2.4 @nrwl/eslint-plugin-nx : Not Found @nrwl/express : Not Found @nrwl/jest : 9.2.4 @nrwl/linter : Not Found @nrwl/nest : Not Found @nrwl/next : Not Found @nrwl/node : Not Found @nrwl/react : Not Found @nrwl/schematics : 8.12.11 @nrwl/tao : 9.2.4 @nrwl/web : Not Found @nrwl/workspace : 9.2.4 typescript : 3.8.3 -
3rd-party libraries and their versions { “name”: “soft”, “private”: true, “version”: “0.0.0”, “dependencies”: { “@angular/animations”: “~9.1.6”, “@angular/cdk”: “^9.2.3”, “@angular/common”: “~9.1.6”, “@angular/compiler”: “~9.1.6”, “@angular/core”: “~9.1.6”, “@angular/forms”: “~9.1.6”, “@angular/platform-browser”: “~9.1.6”, “@angular/platform-browser-dynamic”: “~9.1.6”, “@angular/router”: “~9.1.6”, “@nrwl/angular”: “9.2.4”, “devextreme”: “20.1.3”, “devextreme-angular”: “20.1.3”, “devextreme-schematics”: “^1.2.0”, “rxjs”: “~6.5.5”, “tslib”: “^1.11.2”, “zone.js”: “~0.10.3” }, “devDependencies”: { “@angular-devkit/build-angular”: “~0.901.5”, “@angular/cli”: “~9.1.5”, “@angular/compiler-cli”: “~9.1.6”, “@angular/language-service”: “~9.1.6”, “@nrwl/jest”: “9.2.4”, “@nrwl/schematics”: “^8.12.11”, “@nrwl/workspace”: “^9.2.4”, “@types/jest”: “^25.2.1”, “@types/node”: “^13.13.5”, “@typescript-eslint/eslint-plugin”: “^2.32.0”, “@typescript-eslint/parser”: “^2.32.0”, “babel-eslint”: “^10.1.0”, “codelyzer”: “^5.2.2”, “devextreme-cli”: “latest”, “devextreme-themebuilder”: “20.1.3”, “eslint”: “^7.0.0”, “eslint-config-prettier”: “^6.11.0”, “eslint-plugin-prettier”: “^3.1.3”, “husky”: “^4.2.5”, “jest”: “^26.0.1”, “jest-preset-angular”: “^8.2.0”, “prettier”: “^2.0.5”, “prettier-eslint-cli”: “^5.0.0”, “ts-jest”: “25.2.1”, “ts-node”: “~8.10.1”, “tslint”: “~6.1.2”, “typescript”: “~3.8.3” },
-
and most importantly - a use-case that fails
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:
- Created 3 years ago
- Comments:11 (3 by maintainers)
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.
npx generate @nrwl/angular:library --name=products --style=scss --no-interactive --dry-run