Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prompt shows a warning on node >= v14.2.0 #2845

Closed
davidfirst opened this issue Jul 15, 2020 · 3 comments
Closed

prompt shows a warning on node >= v14.2.0 #2845

davidfirst opened this issue Jul 15, 2020 · 3 comments
Labels

Comments

@davidfirst
Copy link
Member

davidfirst commented Jul 15, 2020

Describe the bug

When running a command that uses prompt, such as bit remove on node version v14.2.0 or above, it throws a warning.

Steps to Reproduce

  1. use node >= v14.2.0
  2. bit remove your-component

You'll get the following error:

➜  nm node --trace-warnings ~/teambit/bit/bin/bit.js remove bit.tmp1/foo-bar
are you sure you would like to proceed with this operation? (yes[y]/no[n])':  (node:3829) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
    at emitCircularRequireWarning (internal/modules/cjs/loader.js:823:11)
    at Object.get (internal/modules/cjs/loader.js:837:5)
    at Object.exports.setLevels (/Users/davidfirst/teambit/bit/node_modules/prompt/node_modules/winston/lib/winston/common.js:35:14)
    at Object.<anonymous> (/Users/davidfirst/teambit/bit/node_modules/prompt/node_modules/winston/lib/winston.js:84:8)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Module.require (internal/modules/cjs/loader.js:1089:19)
    at require (internal/modules/cjs/helpers.js:73:18)
    at Object.<anonymous> (/Users/davidfirst/teambit/bit/node_modules/prompt/lib/prompt.js:14:15)
    at Module._compile (internal/modules/cjs/loader.js:1200:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
    at Module.load (internal/modules/cjs/loader.js:1049:32)
    at Function.Module._load (internal/modules/cjs/loader.js:937:14)
    at Module.require (internal/modules/cjs/loader.js:1089:19)

Expected Behavior

should show a prompt message asking you to enter yes/no.

Specifications

  • Bit version: 14.8.8
  • Node version: 14.2.0
  • npm / yarn version:
  • Platform:
  • Bit compiler (include version):
  • Bit tester (include version):

Additional context

This is happening due to the prompt package that requires an old version of Winston. See flatiron/prompt#199 for more info.

Sadly, this package is not maintained. An alternative could be https://www.npmjs.com/package/enquirer or forking prompt and upgrading its Winston version.

@davidfirst davidfirst changed the title prompt is not working on node >= v14.2.0 prompt shows a warning on node >= v14.2.0 Jul 15, 2020
@GiladShoham
Copy link
Member

We already use inquirer for some stuff like interactive.. We should just use it instead and remove prompt

@pollen8
Copy link

pollen8 commented Aug 27, 2020

I'm new to bit and I found this really confusing as it occurred when I tried to export for the first time. It just looked like the export process had stalled.

@davidfirst
Copy link
Member Author

Seems to be fixed now. The prompt package has released a new version 1.1.0 two months ago. I tried the bit remove command with node v14.5.0 and didn't get the warning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants