[SOLVED] [Linter] Error running JSHint - Ubuntu 16.04


#1

RAM : 6 GB OS: Ubuntu 16.04 LTS

[Linter] Error running JSHint
See Console for more info. (Open View -> Developer -> Toggle Developer Tools)

I also have Base Linter Installed and Linter-JSCS
When i hit Cmd + S to save a .js file, this pop up comes in Atom.
JSCS works fine but JSHint does not work and I need help.

This is the log from developer tools, hope it helps.

/home/snak3/.atom/packages/linter/lib/linter-registry.js:159 [Linter] Error running JSHint Error: module.js:472
throw err;
^

Error: Cannot find module '/path/to/bundled/jshint’
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:424:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:544:3
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:424:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:544:3
at ChildProcess. (/home/snak3/.atom/packages/linter-jscs/node_modules/sb-exec/lib/index.js:56:20)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:885:16)
at Socket. (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)
(anonymous) @ /home/snak3/.atom/packages/linter/lib/linter-registry.js:159
/home/snak3/.atom/packages/linter/lib/linter-registry.js:159 [Linter] Error running JSHint Error: module.js:472
throw err;
^

Error: Cannot find module '/path/to/bundled/jshint’
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:424:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:544:3
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:424:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:544:3
at ChildProcess. (/home/snak3/.atom/packages/linter-jscs/node_modules/sb-exec/lib/index.js:56:20)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:885:16)
at Socket. (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)
(anonymous) @ /home/snak3/.atom/packages/linter/lib/linter-registry.js:159
/home/snak3/.atom/packages/linter/lib/linter-registry.js:159 [Linter] Error running JSHint Error: module.js:472
throw err;
^

Error: Cannot find module '/path/to/bundled/jshint’
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:424:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:544:3
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:424:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:544:3
at ChildProcess. (/home/snak3/.atom/packages/linter-jscs/node_modules/sb-exec/lib/index.js:56:20)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:885:16)
at Socket. (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)
(anonymous) @ /home/snak3/.atom/packages/linter/lib/linter-registry.js:159
/home/snak3/.atom/packages/linter/lib/linter-registry.js:159 [Linter] Error running JSHint Error: module.js:472
throw err;
^

Error: Cannot find module '/path/to/bundled/jshint’
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:424:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:544:3
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:424:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:544:3
at ChildProcess. (/home/snak3/.atom/packages/linter-jscs/node_modules/sb-exec/lib/index.js:56:20)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:885:16)
at Socket. (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)
(anonymous) @ /home/snak3/.atom/packages/linter/lib/linter-registry.js:159
/home/snak3/.atom/packages/linter/lib/linter-registry.js:159 [Linter] Error running JSHint Error: module.js:472
throw err;
^

Error: Cannot find module '/path/to/bundled/jshint’
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:424:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:544:3
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.runMain (module.js:605:10)
at run (bootstrap_node.js:424:7)
at startup (bootstrap_node.js:147:9)
at bootstrap_node.js:544:3
at ChildProcess. (/home/snak3/.atom/packages/linter-jscs/node_modules/sb-exec/lib/index.js:56:20)
at emitTwo (events.js:106:13)
at ChildProcess.emit (events.js:191:7)
at maybeClose (internal/child_process.js:885:16)
at Socket. (internal/child_process.js:334:11)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at Pipe._handle.close [as _onclose] (net.js:501:12)


#2

That doesn’t sound like a real file name. In the settings for linter-jshint (Settings -> Packages -> linter-jshint), do you see that path set as the target for the package?


#4

so i add

‘linter-jshint’:

Path of the jshint executable

executablePath: ‘/path/to/bundled/jshint’

Lint JavaScript inside <script> blocks in HTML or PHP files

lintInlineJavaScript: false

Disable linter when no .jshintrc is found in project

disableWhenNoJshintrcFileInPath: false

to the file ~/.atom/config.cson?


#5

So I installed the npm module.
user@XuB:~$ npm install -g jshint
/home/user/.nvm/versions/node/v8.6.0/bin/jshint -> /home/user/.nvm/versions/node/v8.6.0/lib/node_modules/jshint/bin/jshint

  • jshint@2.9.5
    added 31 packages in 4.695s

AND IN JSHINT SETTINGS I PUT PATH AS /home/user/.nvm/versions/node/v8.6.0/lib/node_modules/jshint/bin/jshint

Is it correct? or should i put /home/user/.nvm/versions/node/v8.6.0/bin/jshint ?


#6

Such a stupid mistake, In the end i had to download jshint by going to CLI and running
npm install -g jshint

and then I got the path : /home/user/.nvm/versions/node/v8.6.0/bin/jshint
and I put this path in the package settings.

Thank you @DamnedScholar for the help in figuring out the path issue.