angular-cli: ng new my-app causes This command can not be run inside of a CLI project.


Node v8.11.1
NPM 5.6.0
Windows 10 64 bit

Repro steps

  • install next version of @angular/cli@next
  • Create new project with ng new my_project
  • See error message

Observed behavior

This command can not be run inside of a CLI project.

Desired behavior

New project should be created.

Mention any other details that might be useful (optional)

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 3
  • Comments: 16

Commits related to this issue

Most upvoted comments

delete all .angular* files in the user root directory and all will work after

How it is possible to release a new version of angular-cli and not test new project generation?

Build system should be improved.

Maybe we can change the error message to enable users to remove their leftover files without having to google it first…

I am having lot of trouble with his error message. No .angular* files located in my home/root directories.

ng n c <component name> gives this error

This command can not be run inside of a CLI project.

Angular: 6.1.6 … animations, common, compiler, compiler-cli, core, forms … http, language-service, platform-browser … platform-browser-dynamic, router

Package Version

@angular-devkit/architect 0.7.5 @angular-devkit/build-angular 0.7.5 @angular-devkit/build-optimizer 0.7.5 @angular-devkit/build-webpack 0.7.5 @angular-devkit/core 0.7.5 @angular-devkit/schematics 0.8.1 @angular/cdk 6.4.7 @angular/cli 6.2.1 @angular/material 6.4.7 @ngtools/webpack 6.1.5 @schematics/angular 0.8.1 @schematics/update 0.8.1 rxjs 6.3.2 typescript 2.7.2 webpack 4.9.2

This is very disheartening… especially since I am learning angular at the same time.

I got around this issue by removing a stray angular-cli.json file from the folder path where I was trying to install a new Angular app.

I was attempting to install a new app in the directory: /home/vagrant/projects/angular-app

However, inside the /home/vagrant/projects directory was an angular-cli.json file that I kept for a backup. I renamed the file and put a ‘1’ in front of the file name and was able to install successfully after that.