Skip to content

"You cannot use the new command inside an angular-cli project", when the current directory isn't an angular cli generated project #2174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jgo4th opened this issue Sep 16, 2016 · 7 comments

Comments

@jgo4th
Copy link

jgo4th commented Sep 16, 2016

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    MacOSX Yosimite v10.10.5

  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:
    angular-cli: 1.0.0-beta.14
    node: 4.5.0
    os: darwin x64

  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.
    I try to use ng new in any directory on my machine

  4. The log given by the failure. Normally this include a stack trace and some
    more information.
    "You cannot use the new command inside an angular-cli project."

  5. Mention any other details that might be useful.
    I am not inside a project created by the cli. In fact I cant use the command anywhere, in any directory.


    Thanks! We'll be in touch soon.

@JanStureNielsen
Copy link

@jgo4th - the ng new command creates a new project which you cannot do within an existing project. You can, however, use the other commands, e.g., ng generate anywhere within an existing project.

The issue tracker is for bugs and feature requests as noted in CONTRIBUTING.md. For better support, consider creating a question on StackOverflow with all the details.

@jgo4th
Copy link
Author

jgo4th commented Sep 16, 2016

No as in, I cannot use the command ng new in any directory on my device. I am not in any existing projects. What is the cli looking at to determine if its an existing project? Because It believes my Downloads, Documents, and other generic folders, not created by angular-cli, are angular-cli projects. Definitely a blocking issue to even use the CLI.

@jgo4th jgo4th changed the title You cannot use the new command inside an angular-cli project.... In every directory? "You cannot use the new command inside an angular-cli project", when the current directory isn't a angular cli generated project Sep 16, 2016
@jgo4th jgo4th changed the title "You cannot use the new command inside an angular-cli project", when the current directory isn't a angular cli generated project "You cannot use the new command inside an angular-cli project", when the current directory isn't an angular cli generated project Sep 16, 2016
@JanStureNielsen
Copy link

@jgo4th -- please use StackOverflow for support questions.

@jgo4th jgo4th closed this as completed Sep 16, 2016
@filipesilva
Copy link
Contributor

@jgo4th your issue might be related with these two:
#1079
#1045

Do you maybe have a package.json or angular-cli.json somewhere in your home folder? There's probably something up your directory tree that makes the CLI think that it's inside of a project already. The CLI only looks up directories to do this.

@jurrinus
Copy link

jurrinus commented Nov 3, 2016

I went to my home directory and in my package.json removed all references to angular-cli. I was then able to use ng new. MAC-OSX Sierra

@yxh10
Copy link

yxh10 commented Dec 6, 2016

@filipesilva @juliemr Thanks for your answers. I didn't find package.json in my home folder, but in the parent folder. Hopefully, this would help someone else too. :)

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants