angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

ng new my_project fails

Open akanass opened this issue 8 years ago • 9 comments

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

akanass avatar May 02 '18 06:05 akanass

+1

abidev avatar May 02 '18 11:05 abidev

Same here

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

avatsaev avatar May 02 '18 13:05 avatsaev

@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 avatar May 02 '18 15:05 Zyzle

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

akanass avatar May 02 '18 15:05 akanass

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.

rastermechanism avatar Jun 03 '18 03:06 rastermechanism

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.

bytebounder avatar Jun 28 '18 03:06 bytebounder

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

thiagofrancisquete avatar Aug 10 '18 18:08 thiagofrancisquete

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

shaagi avatar May 02 '19 13:05 shaagi

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.