Hey when I create a new…

1 minute read

Hey, when I create a new libray with nx generate @nrwl/angular:library nameofLib --directory=path --unitTestRunner=karma --style=less I am getting the error thatPath "/path/nameofLib/tsconfig.lib.prod.json" does not exist. : Which is true because I wanted to just create it. Am I using the wrong command?

Responses:

Works for me PS C:\projects\sandbox\xxx> nx generate @nrwl/angular:library nameofLib --directory=path --unitTestRunner=karma --style=less CREATE libs/path/nameof-lib/README.md (154 bytes) CREATE libs/path/nameof-lib/tsconfig.lib.json (405 bytes) CREATE libs/path/nameof-lib/tsconfig.lib.prod.json (97 bytes) CREATE libs/path/nameof-lib/tslint.json (265 bytes) CREATE libs/path/nameof-lib/src/index.ts (46 bytes) CREATE libs/path/nameof-lib/src/lib/path-nameof-lib.module.ts (168 bytes) CREATE libs/path/nameof-lib/src/lib/path-nameof-lib.module.spec.ts (385 bytes) CREATE libs/path/nameof-lib/tsconfig.json (121 bytes) CREATE libs/path/nameof-lib/tsconfig.spec.json (207 bytes) CREATE libs/path/nameof-lib/karma.conf.js (498 bytes) CREATE libs/path/nameof-lib/src/test.ts (701 bytes) UPDATE angular.json (8108 bytes) UPDATE nx.json (918 bytes) UPDATE tsconfig.json (939 bytes)

```PS C:\projects\sandbox\xxx> nx version

 _                      _                 ____ _     ___ 
/ \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|    / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |    / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |   /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
            |___/

Angular CLI: 9.1.0 Node: 12.16.1 OS: win32 x64

Angular: 9.1.1 … animations, common, compiler, compiler-cli, core, forms
… language-service, platform-browser, platform-browser-dynamic … router Ivy Workspace: Yes

Package Version

@angular-devkit/architect 0.901.0 @angular-devkit/build-angular 0.901.0 @angular-devkit/build-optimizer 0.901.0 @angular-devkit/build-webpack 0.901.0 @angular-devkit/core 9.1.0 @angular-devkit/schematics 9.1.1 @angular/cli 9.1.0 @ngtools/webpack 9.1.0 @schematics/angular 9.1.0 @schematics/update 0.901.0 rxjs 6.5.5 typescript 3.8.3 webpack 4.42.0```

PS C:\projects\sandbox\xxx> nx --version 9.2.2

Hey Lars, thanks for trying this out. Which version of the angular cli do you got installed? Thanks.

Got it! So I was using Manfred Steyers Library ngx-build-plus which need all(!) versions of Angular updated to version 9 for the latest version of the lib to run. However, my @schematics/angular dependencies was still 8, all the others have been on version 9. So I installed the schematics with yarn add @schematics/angular to get it up to 9 and now it works.

Nice

Updated: