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

TypeError: Cannot read property 'substring' of undefined #4018

Closed
TheEradicated opened this issue Oct 2, 2015 · 16 comments
Closed

TypeError: Cannot read property 'substring' of undefined #4018

TheEradicated opened this issue Oct 2, 2015 · 16 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion blocked This change can't be completed until another issue is resolved bug ESLint is working incorrectly cli Relates to ESLint's command-line interface

Comments

@TheEradicated
Copy link

Freshly installed Eslint v1.5.1. When I run "eslint --init" for the first time, I get this.

C:\Users\John Ryan Camatog\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\node_modules\rx-lite\rx.lite.js:549
    throw e;
    ^

TypeError: Cannot read property 'substring' of undefined
    at Interface.rl._getCursorPos (C:\Users\John Ryan Camatog\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\node_modules\readline2\index.js:55:51)
    at ScreenManager.render (C:\Users\John Ryan Camatog\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\lib\utils\screen-manager.js:19:27)
    at Prompt.render (C:\Users\John Ryan Camatog\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\lib\prompts\list.js:102:15)
    at Prompt._run (C:\Users\John Ryan Camatog\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\lib\prompts\list.js:73:8)
    at Prompt.run (C:\Users\John Ryan Camatog\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\lib\prompts\base.js:57:8)
    at Object.<anonymous> (C:\Users\John Ryan Camatog\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\lib\ui\prompt.js:83:12)
    at module.exports (C:\Users\John Ryan Camatog\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\node_modules\run-async\index.js:15:21)
    at C:\Users\John Ryan Camatog\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\lib\utils\utils.js:16:7
    at tryCatcher (C:\Users\John Ryan Camatog\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\node_modules\rx-lite\rx.lite.js:537:29)
    at setDisposable (C:\Users\John Ryan Camatog\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\node_modules\rx-lite\rx.lite.js:5380:36)
@eslintbot
Copy link

Thanks for the issue! If you're reporting a bug, please be sure to include:

  1. The version of ESLint you are using (run eslint -v)
  2. What you did (the source code and ESLint configuration)
  3. The actual ESLint output complete with numbers
  4. What you expected to happen instead

Requesting a new rule? Please see Proposing a New Rule for instructions.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Oct 2, 2015
@ilyavolodin ilyavolodin added question This issue asks a question about ESLint and removed triage An ESLint team member will look at this issue soon labels Oct 2, 2015
@ilyavolodin
Copy link
Member

Are you using NPM 3 by any chance? Can you check your node_modules directory and find out what version of inquirer you are using?

@TheEradicated
Copy link
Author

I'm using npm 2.14.3. Checked out the inquirer/package.json and this is the version, I think.

  "name": "inquirer",
  "version": "0.9.0",
  "description": "A collection of common interactive command line user interfaces.",
  "main": "lib/inquirer.js",

@gyandeeps
Copy link
Member

What is your OS?
There is a known issue on windows 10.

@TheEradicated
Copy link
Author

I guess it's an issue. I'm running Windows 10 Enterprise LTSB.

@nzakas
Copy link
Member

nzakas commented Oct 3, 2015

I think this is a duplicate of #3395?

@ilyavolodin
Copy link
Member

Doesn't look like it. It's crashing all together, and #3395 describes an issue where the arrow selection is not possible.

@TheEradicated
Copy link
Author

Updated to v1.6.0, same thing (knew that it still isn't fixed). Also, I forgot the line on the top.

@ilyavolodin
Copy link
Member

@TheEradicated I can't reproduce this locally on Windows 8 Professional or Windows 10 Professional. What version of Node are you using? Also, could you try blowing away node_modules directory under your eslint installation and running npm install again?

@ilyavolodin ilyavolodin added the bug ESLint is working incorrectly label Oct 5, 2015
@TheEradicated
Copy link
Author

@ilyavolodin I have Node.js 4.1.0. Deleted the node_modules folder under node_modules/eslint directory, ran npm install -g eslint and eslint --init after that. Same error.

@guilhermehn
Copy link

Same problem here on Win7 Home Premium SP1.

$ eslint -v
v1.6.0

$ node -v
v4.1.1

$ npm -v
2.14.4

The stack:

$ eslint --init

C:\Users\Guilherme\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\node_modules\rx-lite\rx.lite.js:549
    throw e;
    ^

TypeError: Cannot read property 'substring' of undefined
    at Interface.rl._getCursorPos (C:\Users\Guilherme\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\node_modules\readline2\index.js:55:51)
    at ScreenManager.render (C:\Users\Guilherme\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\lib\utils\screen-manager.js:19:27)
    at Prompt.render (C:\Users\Guilherme\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\lib\prompts\list.js:102:15)
    at Prompt._run (C:\Users\Guilherme\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\lib\prompts\list.js:73:8)
    at Prompt.run (C:\Users\Guilherme\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\lib\prompts\base.js:57:8)
    at Object.<anonymous> (C:\Users\Guilherme\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\lib\ui\prompt.js:83:12)
    at module.exports (C:\Users\Guilherme\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\node_modules\run-async\index.js:15:21)
    at C:\Users\Guilherme\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\lib\utils\utils.js:16:7
    at tryCatcher (C:\Users\Guilherme\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\node_modules\rx-lite\rx.lite.js:537:29)
    at setDisposable (C:\Users\Guilherme\AppData\Roaming\npm\node_modules\eslint\node_modules\inquirer\node_modules\rx-lite\rx.lite.js:5380:36)

Removed eslint and installed again, but the problem persists.

@ilyavolodin
Copy link
Member

OK, this is a known issue with inquirer and it's filed here: SBoudrias/Inquirer.js#272
It looks like it's a low priority issue for Inquirer and from some of the comments, it might not be fixable at all. Not really sure what we can do here.

@ilyavolodin ilyavolodin added cli Relates to ESLint's command-line interface blocked This change can't be completed until another issue is resolved and removed question This issue asks a question about ESLint labels Oct 7, 2015
@guilhermehn
Copy link

@ilyavolodin I just tested in Windows Command Prompt and it works fine. The problem happens only when using terminal emulators like mintyy that comes with git for Windows.

From Git for Windows FAQ:

Interactive and full-screen applications won't work at all

I think the issue can be closed, but a feedback about it would be nice, like showing a message if configInit.initializeConfig gets an error that the problem is possibly the terminal emulator.

@TheEradicated
Copy link
Author

I'll use eslint (through SublimeLinter) for Sublime Text 3. Does this mean once I run eslint --init on Command Prompt, it will be good to go?

@ilyavolodin
Copy link
Member

@TheEradicated Yes, if you use WIndows command prompt or powershell it should be fine. Bash for Git doesn't work (although it works for me personally for some reason).

@krantos
Copy link

krantos commented Feb 11, 2016

i try with cmd(windows) and work fine the command 'bower init'

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 7, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion blocked This change can't be completed until another issue is resolved bug ESLint is working incorrectly cli Relates to ESLint's command-line interface
Projects
None yet
Development

No branches or pull requests

7 participants