ngx-rocket / generator-ngx-rocket

:rocket: Extensible Angular 14+ enterprise-grade project generator
https://ngx-rocket.github.io/
MIT License
1.53k stars 217 forks source link

ngx new immediately aborts after splash / header intro without initiating prompts. #494

Closed RAMOhio closed 5 years ago

RAMOhio commented 5 years ago

I'm submitting a...

Current behavior

When running ngx new it shows the splash/header text (see below) but immediately aborts with no error message.

C:\not-a-real-directory>ngx new
          __   __
 _ _  __ _\ \./ / ____ ____ ____ _  _ ____ ___
| ' \/ _` |>   <  |--< [__] |___ |-:_ |===  |
|_||_\__, /_/°\_\ ENTERPRISE APP STARTER -~*=>
     |___/ v7.0.2

C:\not-a-real-directory>

Expected behavior

The generator should initiate the prompts that'll lead to the generation of a new project.

Minimal reproduction of the problem with instructions

  1. npm install -g generator-ngx-rocket
  2. ngx new

Environment



ngX-Rocket: 7.0.2
Node.js: v10.16.2
Npm: 6.11.1
OS: win32 x64 10.0.17134

Others:

Windows 10 Professional Deleted entire global node modules, tried to reinstall just generator-ngx-rocket, tried to angular/cli first then the generator, reversed that, no matter what the same thing happens.

sinedied commented 5 years ago

Thanks for the complete report, I saw that one on a coworker's machine but could never know it's exact environment to reproduce it. Could you try running it from a folder with no spaces and as close to the root as possible? (Like C:/test) I'm in vacation right now with no windows machine at hand, but I will look at it as soon as I can.

RAMOhio commented 5 years ago

Thanks for the complete report, I saw that one on a coworker's machine but could never know it's exact environment to reproduce it. Could you try running it from a folder with no spaces and as close to the root as possible? (Like C:/test) I'm in vacation right now with no windows machine at hand, but I will look at it as soon as I can.

Thanks for the quick reply! I just tried running it in C:\test and the same thing happened.

I'll try playing around with it some and if I can figure anything out, I'll post here. Seems like a really useful tool, a former colleague has spoken highly of it for a while and I'm excited to give it a shot when I get it up and going.

RAMOhio commented 5 years ago

I've tracked down the problem to be something with the analytics / Insight. I went through index.js and commented out everything referencing Insight and it appears to be working at first look (haven't fully tested this yet). Note that it doesn't work to use the flag --no-analytics, the code referencing Insight needed commented out.

RAMOhio commented 5 years ago

I'm not very familiar with GitHub and Javascript definitely isn't one of my stronger languages, but I've created a pull request with an error handler and a few bugfixes related to the Insight issue. Please forgive any errors, I tried to keep things as clean and consistent as possible.

https://github.com/ngx-rocket/generator-ngx-rocket/pull/495

sinedied commented 5 years ago

Many thanks for the PR! I have made a few comments there, with some minor changes it will be perfect 👍

bursauxa commented 5 years ago

Thanks for the PR 😃

Although it is an improvement over the previous situation and we should definitely go for it in the meantime, it doesn't solve the root issue that new Insight() should not crash...

sinedied commented 5 years ago

Closed by #496 Will definitely need to investigate this further and report the issue upstream, but in the meantime at least it prevents unwanted crashes. I will open a new issue for this.