question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItΒ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

The analytics prompt shouldn't run in CI environments

See original GitHub issue

🐞 Bug report

Command (mark with an x)

npm install

Is this a regression?

Yes, the previous version in which this bug was not present was:

v7 and below

Description

When upgrading to v8 the analytics prompt breaks CI as it hangs infinitely waiting for the user to choose to enable it or not

πŸ”¬ Minimal Reproduction

Run npm install on a v8 cli project on CI. For example: https://travis-ci.org/mattlewis92/angular-calendar/builds/538499347

Attempting to disable analytics on the project then fails as the config it adds to angular.json is invalid

ng analytics project off
Screenshot 2019-05-29 at 09 57 39

πŸ”₯ Exception or Error

Screenshot 2019-05-29 at 09 53 42

🌍 Your Environment


Angular CLI: 8.0.0
Node: 12.1.0
OS: darwin x64
Angular: 8.0.0
... animations, cdk, cli, common, compiler, compiler-cli, core
... forms, language-service, platform-browser
... platform-browser-dynamic, router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.800.0
@angular-devkit/build-angular      0.800.0
@angular-devkit/build-ng-packagr   0.800.0
@angular-devkit/build-optimizer    0.800.0
@angular-devkit/build-webpack      0.800.0
@angular-devkit/core               8.0.0
@angular-devkit/schematics         8.0.0
@ngtools/json-schema               1.1.0
@ngtools/webpack                   8.0.0
@schematics/angular                8.0.0
@schematics/update                 0.800.0
ng-packagr                         5.2.0
rxjs                               6.5.2
typescript                         3.4.5
webpack                            4.30.0

Anything else relevant?

The is-ci package could be used to disable that prompt on CI envs: https://www.npmjs.com/package/is-ci

The analytics config needs to be added to the schema so it can be disabled at the project level

The workaround for now is to add this to travis.yml

before_install: npx @angular/cli analytics off

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:8
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
mgechevcommented, May 29, 2019

You can set this flag in your CI to disable the analytics. We’ll work on fixing this in the next patch release.

1reaction
mattlewis92commented, May 29, 2019

Awesome, thanks @mgechev! btw it might be worth documenting the NG_CLI_ANALYTICS variable here: https://angular.io/analytics

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use Forge CLI in a CI environment?
I've trying to run Forge CLI in our GitHub workflows but I keep receiving the following message: Error: Keytar error detected: Cannot autolaunch...
Read more >
Set a predefined list of values for CI environment variables ...
Set a predefined list of values for CI environment variables and surface them in the "Run pipeline" page form.
Read more >
SQL Server database CI Best practices and how to implement ...
In this blog post you will learn about SQL Server database continuous integration (CI), best practices and how to implement them.
Read more >
Use environment variables | Cloud Run Documentation
In particular, the PORT environment variable is injected inside your container by Cloud Run. You should not set it yourself.
Read more >
Advanced workflows - Headless mode for CI/CD - Amplify Docs
The --yes flag, or its alias -y , suppresses command line prompts if ... If you wanted to add the backend environment to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found