← 输入框|github.com|刷新
Skip to content

Locally installed CLI beta.31 is not initializing the project ('ng init' failed) #4761

Closed

Description

@kuncevic

As per this pull request 761e86f CLI should be able to run without global install.
There was no issues with that until beta.31

OS?

Windows 7

Versions.

My project local CLI, npm run ng -- -v:

@angular/cli: 1.0.0-beta.31
node: 6.9.2
os: win32 x64
@angular/cli: 1.0.0-beta.31

Repro steps.

  • npm init -y
  • alter package.json by adding "ng":"ng" in to scripts (761e86f).
  • install @angular/cli --save
  • npm run ng -- init

The log given by the failure.

c:\Projects\my-app>npm run ng -- init

> my-app@1.0.0 ng c:\Projects\my-app
> ng "init"

installing ng2
? Overwrite package.json? Yes, overwrite

c:\Projects\my-app>

Expected

installing ng2
? Overwrite package.json? Yes, overwrite
  create .editorconfig
  create README.md
  create src\app\app.component.css
  create src\app\app.component.html
  create src\app\app.component.spec.ts
  create src\app\app.component.ts
  create src\app\app.module.ts
  create src\environments\environment.prod.ts
  create src\environments\environment.ts
  create src\index.html
  create src\main.ts
  create src\polyfills.ts
  create src\styles.css
  create src\test.ts
  create src\tsconfig.json
  create angular-cli.json
  create e2e\app.e2e-spec.ts
  create e2e\app.po.ts
  create e2e\tsconfig.json
  create .gitignore
  create karma.conf.js
  overwrite package.json
  create protractor.conf.js
  create tslint.json
Successfully initialized git.
Installing packages for tooling via npm.

Mention any other details that might be useful.

Working with locally installed beta.30 and below.

p.s:
Also I tried to run npm run ng -- update as per this PR 2211172 but having exactly same thing happening.

Activity

  1. changed the title [-]CLI not initializing the project without install ('ng init' failed)[/-] [+]Locally installed CLI beta.31 is not initializing the project ('ng init' failed)[/+] on Feb 16, 2017
  2. Meligy commented on Feb 17, 2017

    @Meligy
    Contributor

    Duplicate of #4653 / #4584.

  3. kuncevic commented on Feb 17, 2017

    @kuncevic
    Author

    @Meligy Yeah i c, in my case I am initializing just fresh project having package.json like that:

    {
      "name": "my-app",
      "version": "1.0.0",
      "description": "",
      "main": "index.js",
      "scripts": {
        "ng": "ng"
      },
    }
    

    having just single file in my project folder which is package.json.
    If it is makes any difference

  4. Meligy commented on Feb 17, 2017

    @Meligy
    Contributor

    I'm afraid it doesn't matter. The command was broken in beta.31, and now it's removed in master. It won't be there in v1.0 final, and will not exist again until it's rewritten for v2.0.

  5. kuncevic commented on Feb 17, 2017

    @kuncevic
    Author

    So i c PR #4628 that removing init and update.
    But how would you initialize a new CLI app without having CLI globally installed? It is seams to be impossible now.

  6. Meligy commented on Feb 17, 2017

    @Meligy
    Contributor

    At the moment you'll have to download the CLI to another folder different from the new project folder and use it.

    At least until something happens with #4762 and it gets opened / superseded with something.

  7. angular-automatic-lock-bot commented on Sep 6, 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.

  8. locked and limited conversation to collaborators on Sep 6, 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