Skip to content

Proposal: Stop ng new going up one directory in search for package.json #4216

Closed

Description

@gotofritz

Hi. I have also got bitten by #1079 (summary: if you do ng new xxx in an empty folder, and the parent folder has a package.json, the new project will be created in the parent folder).

I fail to see a realistic user case where one may need that. It causes only confusion (if you look at the original bug it has already 5 duplicates, showing that it is a common enough problem). And as far as I can see, new doesn't actually fetch any information from the package.json, so I'm at a loss to explain why it is actually looking for it. I think it all stems from the packageJson var in ng,

const packageJson = require('../package.json');
but I think ng new should disregard it since not relevant in that case.

Activity

  1. changed the title [-]Proposal: Stop `ng new` going up directories in search for package.json[/-] [+]Proposal: Stop `ng new` going up one directory in search for package.json[/+] on Jan 25, 2017
  2. SanderElias commented on Jan 27, 2017

    @SanderElias

    I agree that looking for a package.json does not make sense for ng new. If you have a package.json somewhere up the tree, that does not mean you intend to create the new project there. Usually, you intend to create a new project right where you are.

  3. filipesilva commented on May 22, 2017

    @filipesilva
    Contributor

    Fixed by #4901

  4. angular-automatic-lock-bot commented on Sep 7, 2019

    @angular-automatic-lock-bot

    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.

  5. locked and limited conversation to collaborators on Sep 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions