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

Created on 2 May 2018  路  16Comments  路  Source: angular/angular-cli

Versions

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)

2 (required)

Most helpful comment

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

All 16 comments

hy @javadev your issue is duplicate of #10590 I've reported this morning too

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

Build system should be improved.

Seems to be fixed on master

Same issue here.

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

Works now, thanks!

In the folder you are targeting, if there is an angular-cli.json file, remove it. Worked for me.

Update @angular/cli to latest version 6.0.1 and it started working.

I updated @angular/cli to latest version 6.0.3 and the message occurs again. But deleting all .angular* files the problem is eliminated.

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

I'm working on a Mac. I tried looking for the files .angular* on the following directories:

/Users/XXXX

/

I couldn't find the files there. Where else am I supposed to look?

Still happening to me. Have tried to uninstall -g and install the lastest version, but did't work.

Versions

Angular CLI: 6.1.5
Node: 10.0.0
NPM: 6.4.0
Win 10 x64

Where are theses .angular* files?

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

ng n c 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.

Try to run cmd as Administrator

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.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hartjo picture hartjo  路  3Comments

hareeshav picture hareeshav  路  3Comments

gotschmarcel picture gotschmarcel  路  3Comments

jmurphzyo picture jmurphzyo  路  3Comments

MateenKadwaikar picture MateenKadwaikar  路  3Comments