1

Actually I've used angular in windows and I didn't faced this problem after updated to ng 4. But when i'm trying this to ubuntu after updating to ng 4, I'm facing this issue while trying to create a new app using ng new command. See the below image. enter image description here

6
  • The trick is to read the error message: You cannot use ng new inside an angular CLI project. It's very clear. You're already inside an angular CLI projet, and you're trying to create a project inside that project. Don't do that, as the message says. Commented Aug 10, 2017 at 18:26
  • Is there already a my-app directory present? Commented Aug 10, 2017 at 18:26
  • but, actually i'm not in inside of any angular project and i never created any in this OS yet! Commented Aug 10, 2017 at 18:27
  • @nitind nope, nothing is there, imgur.com/qEcb064 Commented Aug 10, 2017 at 18:29
  • This is a time for ls -a if ever there was one. Commented Aug 10, 2017 at 18:41

1 Answer 1

1

It seems like you have an npm project (a package.json file) within your desktop folder or in the path above. Either delete or move that project or put your new project in a different directory. see https://github.com/angular/angular-cli/issues/2818#issuecomment-257964822

Sign up to request clarification or add additional context in comments.

3 Comments

Nope, I cannot create on other folders too: imgur.com/Km8VxZW :( Edit - 1: Let me search for any.
It goes all the way up. So if you try ng new project within ~/dir1/dir2 and you have a package.json in dir1, it will still fail. In your console, run pwd and check all directories
Yep, ng new command works on other drives. I'm trying the way metioned on the github source. Thanks BTW.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.