Angular-cli: ng new my_project fails

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

Versions

Angular CLI: 6.0.0-rc.9
Node: 10.0.0
OS: darwin x64

Repro steps

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

Observed behavior

$ cd Programmation/Angular/
$ ng new my_project
This command can not be run inside of a CLI project.

Desired behavior

Can create and generate new project with command-line

Mention any other details that might be useful (optional)

Folder where I want to create the new project isn't an Angular project, only my root folder of all my Angular projects.
All is working fine with @angular/[email protected] and fails with others next versions rc.7, rc.8 and rc.9

Most helpful comment

@njl07 Do you have a .angular.json file in your users home dir? At some point it looks like this global config file was renamed .angular-config.json and having the old .angular.json present above the directory you're trying to create makes the CLI think you're already inside an angular project.

All 9 comments

+1

Same here

CLI 6 RC9
OS Ubuntu 16
Node 8&9
npm 5&6

@njl07 Do you have a .angular.json file in your users home dir? At some point it looks like this global config file was renamed .angular-config.json and having the old .angular.json present above the directory you're trying to create makes the CLI think you're already inside an angular project.

@Zyzle thanks a lot it was the case. When I deleted those files all is working now.

Cool, I was running this command inside a folder name test on Desktop. However I kept a file name .angular.json as backup on Desktop. So it was creating problem. I simply deleted that file and now it is working perfect.

I had to delete all the .angular* file from my home directory on Windows 10. Post this, installed latest cli using npm install --save-dev @angular/cli@latest . This did the trick, and my ng new is working now.

When I delete the angular file I receive this error:

_Local workspace file ('angular.json') could not be found.
Error: Local workspace file ('angular.json') could not be found._

ng-serve still not working

deleted the .angular.json file in the directory like @Zyzle mentioned allowed ng new to work for me

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

gotschmarcel picture gotschmarcel  路  3Comments

sysmat picture sysmat  路  3Comments

jmurphzyo picture jmurphzyo  路  3Comments

hareeshav picture hareeshav  路  3Comments

hartjo picture hartjo  路  3Comments