-
Notifications
You must be signed in to change notification settings - Fork 36
Invalid Result received from JSHint #145
Comments
Can you please post the jshint config you're using? Are you using the bundled jshint or specifying the path explicitly? |
not using a config its on the default .. i checked the default path to jshint in the settings page it seems right and jshint is there everything seems fine and now that you asked i opened my config there is only
so.. it diidn't write to the config or this is normal ? |
It is normal, so can you do this and confirm if it works for you? rm ~/.atom/packages/linter-jshint
apm install linter-jshint |
nope same issue |
Okay, so can you post the output of
|
{
"name": "atom-linter",
"version": "2.0.1",
"description": "base atom linter classes",
"main": "lib/helpers",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/AtomLinter/atom-linter.git"
},
"keywords": [
"atom",
"linter"
],
"author": {
"name": "Dmitry Tsoy"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/AtomLinter/atom-linter/issues"
},
"homepage": "https://github.com/AtomLinter/atom-linter#readme",
"dependencies": {
"xregexp": "latest"
},
"gitHead": "7aefdf7554abbb4c9983730293a4f11726b944f4",
"_id": "atom-linter@2.0.1",
"_shasum": "dbe3fa35dcfd40752e62a6b07521a265f1829d8e",
"_from": "atom-linter@>=2.0.0 <3.0.0",
"_npmVersion": "2.12.1",
"_nodeVersion": "2.3.4",
"_npmUser": {
"name": "steelbrain",
"email": "foo@gmail.com"
},
"dist": {
"shasum": "dbe3fa35dcfd40752e62a6b07521a265f1829d8e",
"tarball": "http://registry.npmjs.org/atom-linter/-/atom-linter-2.0.1.tgz"
},
"maintainers": [
{
"name": "hd-deman",
"email": "hd.deman@gmail.com"
},
{
"name": "steelbrain",
"email": "foo@gmail.com"
},
{
"name": "asaayers",
"email": "Asa@AsaAyers.com"
}
],
"directories": {},
"_resolved": "https://registry.npmjs.org/atom-linter/-/atom-linter-2.0.1.tgz",
"readme": "ERROR: No README data found!"
} |
Now I am super-confused, it looks fine! why doesn't it work 😃 |
no idea.. can i create some dump file or something for you ?? |
Sure. Anything that helps me reproduce this behaviour |
is there anything specific i need to run for linter-jshint error/dump/debug file ?? |
What's your atom version again? |
1.0.2 latest version |
@AtomLinter/linter @AtomLinter/owners any ideas? |
I'm also having this issue on Windows 8.1 now as well, but didn't have the problem with version 1.1.1. I don't have a .jshint config file either, so it is just running as default. I already tried removing and reinstalling the package as well. Atom: 1.0.2 $ cat ~/.atom/packages/linter-jshint/node_modules/atom-linter/package.json {
"name": "atom-linter",
"version": "2.0.1",
"description": "base atom linter classes",
"main": "lib/helpers",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+ssh://git@github.com/AtomLinter/atom-linter.git"
},
"keywords": [
"atom",
"linter"
],
"author": {
"name": "Dmitry Tsoy"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/AtomLinter/atom-linter/issues"
},
"homepage": "https://github.com/AtomLinter/atom-linter#readme",
"dependencies": {
"xregexp": "latest"
},
"gitHead": "7aefdf7554abbb4c9983730293a4f11726b944f4",
"_id": "atom-linter@2.0.1",
"_shasum": "dbe3fa35dcfd40752e62a6b07521a265f1829d8e",
"_from": "atom-linter@>=2.0.0 <3.0.0",
"_npmVersion": "2.12.1",
"_nodeVersion": "2.3.4",
"_npmUser": {
"name": "steelbrain",
"email": "foo@gmail.com"
},
"dist": {
"shasum": "dbe3fa35dcfd40752e62a6b07521a265f1829d8e",
"tarball": "http://registry.npmjs.org/atom-linter/-/atom-linter-2.0.1.tgz"
},
"maintainers": [
{
"name": "hd-deman",
"email": "hd.deman@gmail.com"
},
{
"name": "steelbrain",
"email": "foo@gmail.com"
},
{
"name": "asaayers",
"email": "Asa@AsaAyers.com"
}
],
"directories": {},
"_resolved": "https://registry.npmjs.org/atom-linter/-/atom-linter-2.0.1.tgz",
"readme": "ERROR: No README data found!"
} |
On Linux, I upgraded from linter-jshint from 1.1.1 to 1.1.2 today and I received the same issue. By downgrading atom-linter to 2.0.0, the issue went away. |
@Dilatorily that doesn't really make any sense, as the patch release only contains one commit steelbrain/atom-linter#11 |
@steelbrain I would guess there are unwanted attributes in the It still seems to be working if I only copy the _exec: (command, args = [], options = {}, isNodeExecutable = false) ->
options.stream ?= 'stdout'
options.env ?= {}
options.env.PATH = process.env.PATH
return new Promise (resolve, reject) ->
if isNodeExecutable
options.env ?= {}
options.env.ATOM_SHELL_INTERNAL_RUN_AS_NODE = '1' # Needed for electron
spawnedProcess = child_process.spawn(command, args, options)
data = []
if options.stream is 'stdout'
spawnedProcess.stdout.on 'data', (d) -> data.push(d.toString())
else if options.stream is 'stderr'
spawnedProcess.stderr.on 'data', (d) -> data.push(d.toString())
if options.stdin
spawnedProcess.stdin.write(options.stdin.toString())
spawnedProcess.stdin.end() # We have to end it or the programs will keep waiting forever
spawnedProcess.on 'error', (err) ->
reject(err)
spawnedProcess.on 'close', ->
resolve(data.join('')) |
@Dilatorily we actually have to copy a few |
Which ones do we need exactly? |
The only variable that is set is |
I've got this problem too :( |
Also having this issue on Windows in Atom it seems to be occurring on line 75 of main.coffee right after the JSON.parse(output) |
Same issue this morning with last 1.1.2 update |
Can anyone confirm that downgrading |
My technical know-how is not great on this, I'll give it a shot if you can tell me where to look? |
|
Yup that fixed the problem! Cheers for the help man. Any idea what's causing the issue? |
Ummm, can you change the executable path to require('path').join(__dirname, '..', '.bin', 'jshint') |
I have the same problem on Windows 7 & 8.1 machines. jshint is unusable for me. :( |
Still the same problem. It uses the correct path to an existing .bin\jshint file, but this file is directly executable only in Unix. On Windows it needs to be executed as an argument to the node executable. |
Aaahh! I'll try something myself as soon as I'm on windows |
i played around a bit with your path this fixed it return helpers.exec(path.join(__dirname, '..', 'node_modules/.bin', 'jshint.cmd'), parameters, {stdin: text}).then (output) -> had to add |
@ahmed-90 does it work with this path? 'cause if it does then it's a very likely electron problem. |
Works for me with the jshint.cmd path. |
yes it worked for me it was looking for jshint at |
One more confirmation that downgrading to 2.0.0 works, OS X 10.10. I use nvm and don't have a global Node installed. |
steelbrain/atom-linter#13 is gonna fix this people |
So people, we are unable to reproduce this behaviour, we are gonna need someone who is affected by this bug to contact us in #linter of atom slack and/or maybe share screens to help debug this. |
It would help if people could report, when experiencing this issue:
|
Also, as I said in an earlier comment, the moment I pass the Here is the dump of my ATOM_HOME: "/home/dang/.atom"
ATOM_SHELL_INTERNAL_RUN_AS_NODE: "1"
CHROME_DESKTOP: "Atom.desktop"
CLUTTER_IM_MODULE: "xim"
DBUS_SESSION_BUS_ADDRESS: "unix:abstract=/tmp/dbus-nyvF2sAylO,guid=cb7784eb91c79f0b15af69da55adbf78"
DEFAULTS_PATH: "/usr/share/gconf/gnome.default.path"
DESKTOP_SESSION: "gnome"
DISPLAY: ":0"
GDMSESSION: "gnome"
GIO_LAUNCHED_DESKTOP_FILE: "/usr/share/applications/atom.desktop"
GIO_LAUNCHED_DESKTOP_FILE_PID: "3310"
GJS_DEBUG_OUTPUT: "stderr"
GJS_DEBUG_TOPICS: "JS ERROR;JS LOG"
GNOME_DESKTOP_SESSION_ID: "this-is-deprecated"
GPG_AGENT_INFO: "/run/user/1000/keyring/gpg:0:1"
GTK_IM_MODULE: "xim"
HOME: "/home/dang"
LANG: "en_CA.UTF-8"
LANGUAGE: "en_CA:en"
LOGNAME: "dang"
MANDATORY_PATH: "/usr/share/gconf/gnome.mandatory.path"
NODE_ENV: "production"
NODE_PATH: "/usr/share/atom/resources/app.asar/exports"
PATH: "/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games"
PWD: "/home/dang"
QT4_IM_MODULE: "xim"
QT_IM_MODULE: "ibus"
SESSION_MANAGER: "local/ubuntu:@/tmp/.ICE-unix/1623,unix/ubuntu:/tmp/.ICE-unix/1623"
SHELL: "/bin/bash"
SHLVL: "0"
SSH_AGENT_PID: "1699"
SSH_AUTH_SOCK: "/run/user/1000/keyring/ssh"
USER: "dang"
USERNAME: "dang"
WINDOWPATH: "7"
XAUTHORITY: "/var/run/gdm/auth-for-dang-PXLPoq/database"
XDG_CONFIG_DIRS: "/etc/xdg/xdg-gnome:/etc/xdg"
XDG_CURRENT_DESKTOP: "GNOME"
XDG_DATA_DIRS: "/usr/share/gnome:/usr/local/share/:/usr/share/"
XDG_MENU_PREFIX: "gnome-"
XDG_RUNTIME_DIR: "/run/user/1000"
XDG_SEAT: "seat0"
XDG_SESSION_DESKTOP: "gnome"
XDG_SESSION_ID: "c2"
XDG_VTNR: "7"
XMODIFIERS: "@im=ibus" |
@Dilatorily you posted your Google api key there. You should change it, because there are usually automated bots hunting github for private keys. |
Just upgraded to ver 1.1.2 and got the same issue. |
For anybody in need of a quick fix until the problem is actually solved: This is a combination that works for me:
|
@BlaM: Thanks. It works. |
@steelbrain am in the slack channel pm me when you want to test :) |
@steelbrain here is the code you requested: _exec: (command, args = [], options = {}, isNodeExecutable = false) ->
options.stream ?= 'stdout'
options.env ?=
Path: process.env.Path
PATH : process.env.PATH
HOMEDRIVE: process.env.HOMEDRIVE
HOMEPATH: process.env.HOMEPATH
HOME: process.env.HOME
USER: process.env.USER
USERNAME: process.env.USERNAME |
To all the other participants, I went on teamviewer with @ahmed-90 and narrowed the bug down to the line where we are doing
Removing that line fixes the issue, but it disallows jshint to search for |
As an extra data point to confirm that, I downgraded to 2.0.0 and linting works, but the linter doesn't pick up my |
@filipesilva Thanks for the heads up! It seems my VM copied the environment variables. |
EDIT: I am on Windows 7 Professional. I have the same bug, I'll post my analysis here. I think it's related to this issue: electron/electron#1463. Because when I change the code that calls jshint at main.coffee:52 to this:
it works again. It seems that electron is somehow not picking up on the
set in helpers.coffee:26 EDIT/UPDATE:I should have elaborated a bit: But now it seems that it either ignores the variable or windows screws around with the environment. And by the way, the whole error comes from the binary returning immediately, (because it forks right away) leading to the STDOUT being empty. That is then fed into JSON.parse(). Which is not happy about parsing an empty string (which is confusing in its own right, to be honest.) |
@hellerbarde did you try replacing |
People, I've pushed a patch release, it contains latest version of |
For the record: @steelbrain I did all the research before finding this issue. I only found an old issue at first. So no, I didn't try that yet. I will try your update now. UPDATE: Yep, that fixed it for me. 👍 |
Ive been told by steelbrain/linter#762 to post it here
am getting the exact error on that issue but looks like it was patched at linter but somehow its still there for me
error is a notification:
console only got
JSHint Result:
The text was updated successfully, but these errors were encountered: