2

Hi I am currently using angular 8 with cli version 8.3.17.

I am trying to create an library inside a libs folder instead of the normal projects folder

I tried running:

ng g lib libs/test**

but I get the error:

Project name "libs/test" is not valid. New project names must start with a letter, and must contain only alphanumeric characters or dashes. When adding a dash the segment after the dash must also start with a letter. libs/test

1
  • Did you solve the problem? I have the exact same problem too. Commented Oct 9, 2020 at 7:20

1 Answer 1

2

In your angular.json, you can change newProjectRoot from projects to libs and create the library by running ng g lib test - just note that any apps you generate will also have this path.

Alternatively, Nrwl NX includes cli commands which generates libraries in a /libs directory by default.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.