Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Project name is invalid while creating the project with ng new command

Tags:

angular

I am installed the latest version of angular-cli on my local and trying to create a new project using the command ng new ETG.WEB.UI --style=scss.

I am getting error message Project name ETG.WEB.UI is invalid. It runs successfully if I use command ng new ETG --style=scss

Could somebody tell me if it is genuinely not as per angular-cli permit table naming conventions OR do i simply rename the project from ETG to ETG.WEB.UI once it is created.

like image 831
Tom Avatar asked Jun 09 '18 17:06

Tom


People also ask

Why is NG command not working?

The error “ng command not found” occurs when your system's shell cannot find the path to the ng cli binary. There are three major causes of this error: The ng CLI is not installed. The ng CLI is located in a different directory.

What is NG new command?

ng new command creates a workspace of given name with a default Angular Application. It provides interactive prompts to set optional configurations. All prompts have default values to choose.

How do you solve ng error?

To solve the error "ng: command not found", install the angular cli package globally by running npm install -g @angular/cli@latest and restart your terminal. If the command fails, run it with sudo and make sure the correct PATH is set in your system's environment variable.


1 Answers

Create a new project using a hyphen as the separator then rename the folder it creates.

ng new ETG-WEB-UI --style=scss

This will create a folder named ETG-WEB-UI. Simply rename it to ETG.WEB.UI either in the command prompt or in Windows.

Then run ng serve as normal:

ng serve

I've just tried this and so far I haven't had any issues with the project after renaming it.

like image 153
Jacques Avatar answered Oct 09 '22 01:10

Jacques