GithubHelp home page GithubHelp logo

Comments (10)

raphinesse avatar raphinesse commented on August 20, 2024 2

As I said before, this error only occurs when you have not answered the telemetry prompt before. Thus, a valid work-around would be to add "optOut": false or "optOut": true to ~/.config/configstore/insight-cordova.json. I don't know where the file is located on Windows, unfortunately.

from cordova-cli.

janpio avatar janpio commented on August 20, 2024 1

For Windows it should be in C:\Users\%USERNAME%\.config\configstore\insight-cordova.json

from cordova-cli.

rhysburnie avatar rhysburnie commented on August 20, 2024

Looking at that file:

var permissionTimeout;

        var prompt = inquirer.prompt({
                type: 'confirm',
                name: 'optIn',
                message: msg || defaultMsg,
                default: true
        }, function (result) {
                // clear the permission timeout upon getting an answer
                clearTimeout(permissionTimeout);

                this.optOut = !result.optIn;
                cb(null, result.optIn);
        }.bind(this));

        // add a 30 sec timeout before giving up on getting an answer
        permissionTimeout = setTimeout(function () {
                // stop listening for stdin
                prompt.close();

Two things:

  1. I gave answer well within 30sec timeout so why would it even call that
  2. Either inquirer.prompt does not have .close() or there should be one added to the returned object?

from cordova-cli.

rhysburnie avatar rhysburnie commented on August 20, 2024

OK found the issue will send pr

from cordova-cli.

rhysburnie avatar rhysburnie commented on August 20, 2024

OK FYI the bug is already fixed in the latest on insight package - so you just need to update version

The current insight version being used in cordova 8.1.0 uses a callback mechanism for the inquirer package - that package now has a promise based interface.

from cordova-cli.

brodycj avatar brodycj commented on August 20, 2024

Can you please share the following information:

  • which platform
  • output of node --version
  • output of npm --version

I just tried Cordova CLI 8.1.0 on Node.js 4, 6, 8, and 10 on my Windows PC. I found issue on Node.js 4 and raised issue #339; cordova --version on Cordova CLI 8.1.0 works fine for me on Node.js 6, 8, and 10.

Possibly related: #338

from cordova-cli.

shazron avatar shazron commented on August 20, 2024

I found a repro for this bug on node 8.12.0, npm 6.4.1

from cordova-cli.

raphinesse avatar raphinesse commented on August 20, 2024

I guess the important part here is that you must not have a saved opt-in for this issue to surface.

@brodybits In hindsight, we should have tested the use-case that actually uses inquirer after fiddling with the transitive dependencies. I guess a release with older inquirer should work.

from cordova-cli.

brodycj avatar brodycj commented on August 20, 2024

I just reproduced this issue on Windows:

C:\Users\brodybits\Documents
λ rm -rf \Users\brodybits\.config\

C:\Users\brodybits\Documents
λ cordova --version
? May Cordova anonymously report usage statistics to improve the tool over time? Yes
C:\Users\brodybits\AppData\Local\nvs\node\10.11.0\x64\node_modules\cordova\node_modules\insight\lib\index.js:156
                prompt.close();
                       ^

TypeError: prompt.close is not a function
    at Insight.<anonymous> (C:\Users\brodybits\AppData\Local\nvs\node\10.11.0\x64\node_modules\cordova\node_modules\insight\lib\index.js:156:10)
    at ontimeout (timers.js:425:11)
    at tryOnTimeout (timers.js:289:5)
    at listOnTimeout (timers.js:252:5)
    at Timer.processTimers (timers.js:212:10)

from cordova-cli.

brodycj avatar brodycj commented on August 20, 2024

We just published Cordova CLI 8.1.1 which resolves this issue. In case you encounter this or any other issue in the future please do not hesitate to report it.

from cordova-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.