AtomLinter / linter-htmlhint

Linter plugin for html, using htmlhint
40 stars 19 forks source link

syntax error on document save #65

Closed citrusui closed 8 years ago

citrusui commented 8 years ago

Every time I press save or click CTRL+S to save a document, this pops up. Don't know why. It didn't happen to me in the previous version of linter-htmlhint.

screenshot 13

1000ch commented 8 years ago

Does it occur after re-installing linter-htmlhint? First look, it seems to be broken.

citrusui commented 8 years ago

Yep, reinstalled it and the same error.

johnwebbcole commented 8 years ago

Try uninstalling linter as well as linter-htmlhint, then install linter-htmlhint

apm uninstall linter linter-htmlhint
apm install linter-htmlhint

You can easily reload Atom with Ctrl + Opt + Cmd + l.

I just unloaded and reloaded all of the linter packages and I'm not seeing this error.

AlbertoFdzM commented 8 years ago

Same error here.

Error: C:\Users\Alberto.atom\packages\linter-htmlhint\node_modules.bin\htmlhint:4 case uname in ^^^^

SyntaxError: Unexpected token case at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:413:25) at Object.Module._extensions..js (module.js:452:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:475:10) at startup (node.js:129:18) at node.js:981:3
Error: C:\Users\Alberto\.atom\packages\linter-htmlhint\node_modules\.bin\htmlhint:4
case `uname` in
^^^^

SyntaxError: Unexpected token case
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:413:25)
    at Object.Module._extensions..js (module.js:452:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:475:10)
    at startup (node.js:129:18)
    at node.js:981:3
    at parameters.exit (C:\Users\Alberto\.atom\packages\linter-csslint\node_modules\atom-linter\lib\helpers.js:75:20)
    at triggerExitCallback (C:\Users\Alberto\AppData\Local\atom\app-1.4.0\resources\app.asar\src\buffered-process.js:213:47)
    at ChildProcess.<anonymous> (C:\Users\Alberto\AppData\Local\atom\app-1.4.0\resources\app.asar\src\buffered-process.js:235:18)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
1000ch commented 8 years ago

@AlbertoFdzM Would you try to reinstall following above the @johnwebbcole's comment?

AlbertoFdzM commented 8 years ago

@1000ch I've tried that but still having the error.

More info:

johnwebbcole commented 8 years ago

Can you run htmlhint from the command line?

C:\Users\Alberto\.atom\packages\linter-htmlhint\node_modules\.bin\htmlhint
AlbertoFdzM commented 8 years ago

Done:

C:\Users\Alberto\.atom\packages\linter-htmlhint\node_modules\.bin\htmlhint index.html

Scan 1 files, without errors (15 ms).
johnwebbcole commented 8 years ago

Is this only on Win? I'm not seeing this on OS X, I'll find a windows box and see if I get the same error.

arturparkhisenko commented 8 years ago

Win10 same error (reinstalled linter and linter-htmlhint).

KingRial commented 8 years ago

I can confirm the error on Win10 even after reinstalling

arturparkhisenko commented 8 years ago

@1000ch i think problem somewhere in this commit (rewrite) https://github.com/AtomLinter/linter-htmlhint/commit/7fa5d8cf3e095ab0b14b5ab56735d856195235d6

Arcanemagus commented 8 years ago

@arturparkhisenko if you run the following does the issue go away?

apm uninstall linter-htmlhint
apm install linter-htmlhint@0.2.2
efreitasn commented 8 years ago

@Arcanemagus I was getting this error on my w10 then I ran this and it's working again.

selkinvitaly commented 8 years ago

@Arcanemagus I had the same error. When I return to 0.2.2 version, the error disappeared. Thanks!

ps win7; node5.4.1; npm 3.3.12

KingRial commented 8 years ago

@Arcanemagus I can confirm that installing linter-htmllint@0.2.2 on Windows 10, remove the error.

arturparkhisenko commented 8 years ago

@Arcanemagus yep!

FuzzyAzurik commented 8 years ago

@Arcanemagus Can confirm installing linter-htmllint@0.2.2 removes the error.

garretwilson commented 8 years ago

I just got a big red error after upgrading as well:

Error: C:\Users\garret.atom\packages\linter-htmlhint\node_modules.bin\htmlhint:4 case uname in ^^^^

SyntaxError: Unexpected token case at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:413:25) at Object.Module._extensions..js (module.js:452:10) at Module.load (module.js:355:32) at Function.Module._load (module.js:310:12) at Function.Module.runMain (module.js:475:10) at startup (node.js:129:18) at node.js:981:3
fthebaud commented 8 years ago

I'm having the same problem after upgrading on Windows (Windows 7, Atom 1.4, linter-htmlhint 1.0.0).

However, I'm also using Atom with the same configuration (through the sync-settings package) on another computer running Linux and everything is working fine. (Ubuntu 14.04 LTS, Atom 1.3.2, linter-htmlhint 1.0.0)

NoNameProvided commented 8 years ago

Any progress on this?

AnWeber commented 8 years ago

hello,the error is happening in the call to execNode in file lib/index.js line 60. Using the method exec instead of execNode fixes the issue on a windows 10 system. index.txt. Sorry I'm in hurry and don't want to fork now. The difference is that atom-linter is using a BufferedProcess instead of a BufferedNodeProcess for calling htmlhint by using the method.

Arcanemagus commented 8 years ago

Wow, that definitely sounds like the issue, thanks for taking the time to trace that down @AnWeber.

@1000ch can you put a fix in for that?

1000ch commented 8 years ago

OK. I've just got a Windows 10 today, I'll try to debug this.

arturparkhisenko commented 8 years ago

@AnWeber Thanks! I tested it on Win10x64pro and it's works perfectly :+1:

NoNameProvided commented 8 years ago

Awesome! Will anybody make a PR for this?

1000ch commented 8 years ago

↑ I'll fix this, thank you for debugging @AnWeber !

1000ch commented 8 years ago

Please try v1.0.1.

arturparkhisenko commented 8 years ago

@1000ch all fine :100: thanks!

1000ch commented 8 years ago

@arturparkhisenko Thank you for quick reply :+1:

garretwilson commented 8 years ago

I just updated to v1.0.1 and when saving I get:

Error: 'node' is not recognized as an internal or external command, operable program or batch file.
Error: 'node' is not recognized as an internal or external command,
operable program or batch file.
    at parameters.exit (C:\Users\garret\.atom\packages\linter-htmlhint\node_modules\atom-linter\lib\helpers.js:75:20)
    at triggerExitCallback (C:\Users\garret\AppData\Local\atom\app-1.4.0\resources\app.asar\src\buffered-process.js:213:47)
    at C:\Users\garret\AppData\Local\atom\app-1.4.0\resources\app.asar\src\buffered-process.js:227:18
    at Socket.<anonymous> (C:\Users\garret\AppData\Local\atom\app-1.4.0\resources\app.asar\src\buffered-process.js:98:18)
    at emitOne (events.js:82:20)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)
arturparkhisenko commented 8 years ago

@garretwilson nodejs is installed? i have installed, maybe that's why i can't get this error

NoNameProvided commented 8 years ago

@1000ch Works fine here too! (Win10 Pro 11099)

Thanks for the quick fix! :+1:

garretwilson commented 8 years ago

No, I don't have Node installed other than whatever Atom uses behind the scenes. Your plugin shouldn't require it.

garretwilson commented 8 years ago

maybe that's why i can't get this error

Well, there's one way for you to find out: uninstall Node and try it.

arturparkhisenko commented 8 years ago

@garretwilson @1000ch agree with that! Already tested: i got this error without nodejs too!

AnWeber commented 8 years ago

I think I have found the right way to fix this issue. The path to the htmlhint executable was wrong. I tested this fix on a win10 machine without nodejs:-). Sorry for the previous invalid fix attempt. This fix did just workaround the invalid path. Before releasing, this fix should be tested on a none windows machine.

Arcanemagus commented 8 years ago

v1.0.2 is published which should remove the node requirement, please file a new issue if you are continuing to have problems :wink:.