Skip to content

ng new mistakenly thinks it's in a project #4762

@Meligy

Description

@Meligy

Please provide us with the following information:

OS?

Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)

Windows 8.1

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.31
node: 6.9.4
os: win32 x64
@angular/cli: 1.0.0-beta.31

Repro steps.

Was this an app that wasn't created using the CLI? What change did you do on your code? etc.

mkdir sample
cd sample
yarn add @nagular/cli
node_modules/.bin/ng new sample -dir=.

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.

Mention any other details that might be useful.

  1. This is because the command checks for whether it's in project by looking for the package @angular/cli under node_modules
  2. I think it should be looking for config file .angular-cli.json instead
  3. This is important as ng init / ng update is now gone. It allows me to use the CLI without global installation, earlier I used ng init for this
  4. I'm NOT asking for this to work in existing CLI project. This is NOT a request to make new act as init. The scenario I'm asking to support is when the package exists, but no other files like package.json or .angular-cli.json are present, that is, no Angular CLI project in the folder

Thanks! We'll be in touch soon.

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