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

--stdin causing a TypeError to be thrown with Node v6 #504

Closed
jrmull opened this issue Apr 28, 2016 · 4 comments

Comments

@jrmull
Copy link

commented Apr 28, 2016

I first noticed this after my linting stopped working in SublimeText using SublimeLinter after installing Node v6. It seems to be related to this change nodejs/node#5348

The error can be seen in the Sublime console (with SublimeLinter in debug mode) or at the shell by:

$ cat test.js | standard.cmd --stdin --verbose
standard: Unexpected linter output:

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.extname (path.js:887:5)
    at processText (C:\Users\user\AppData\Roaming\npm\node_modules\standard\node_modules\eslint\lib\cli-engine.js:144:30)
    at CLIEngine.executeOnText (C:\Users\user\AppData\Roaming\npm\node_modules\standard\node_modules\eslint\lib\cli-engine.js:671:26)
    at Linter.lintText (C:\Users\user\AppData\Roaming\npm\node_modules\standard\node_modules\standard-engine\index.js:66:59)
    at C:\Users\user\AppData\Roaming\npm\node_modules\standard\node_modules\standard-engine\bin\cmd.js:112:16
    at process._tickCallback (internal/process/next_tick.js:103:7)
@purepear

This comment has been minimized.

Copy link

commented Apr 30, 2016

Same here

@tjaartvdwalt

This comment has been minimized.

Copy link

commented May 2, 2016

same for me.

If it is any help, it seems the issue was introduced in 6.0.8.

To test it I did

npm install -g standard@6.0.7
echo "console.log('help me!')" | standard --stdin
echo $?
0

And to get the error:

npm install -g standard@6.0.8
echo "console.log('help me!')" | standard --stdin
standard: Unexpected linter output:

TypeError: Path must be a string. Received undefined
    at assertPath (path.js:7:11)
    at Object.extname (path.js:1429:5)
    at processText (/usr/lib/node_modules/standard/node_modules/eslint/lib/cli-engine.js:144:30)
    at CLIEngine.executeOnText (/usr/lib/node_modules/standard/node_modules/eslint/lib/cli-engine.js:671:26)
    at Linter.lintText (/usr/lib/node_modules/standard/node_modules/standard-engine/index.js:65:59)
    at /usr/lib/node_modules/standard/node_modules/standard-engine/bin/cmd.js:112:16
    at process._tickCallback (internal/process/next_tick.js:103:7)

If you think this is a bug in `standard`, open an issue: https://github.com/feross/standard/issues```
@feross

This comment has been minimized.

Copy link
Member

commented May 2, 2016

This looks like an old eslint that is not present in newer version. The reason that standard 6.0.7 works is that it refers to the eslint version with ^. But we pinned eslint using ~ in 6.0.8.

This isn't an issue in standard 7.0.0 anymore since eslint is upgraded. Give standard v7 a try!

@feross feross closed this May 2, 2016

@tjaartvdwalt

This comment has been minimized.

Copy link

commented May 2, 2016

great! thank for fixing it.

@lock lock bot locked as resolved and limited conversation to collaborators May 10, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
4 participants
You can’t perform that action at this time.