Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error integrating ESLint with sublime

Tags:

I am new to Node.js, npm and sublime environment and I am finding it difficult to integrate ESlint with sublime editor.

The steps which I followed is as follows:

  1. Installed ESLint with command: npm install -g eslint
  2. Installed ESLint with Sublime package control

Now getting following error in Sublime editor:

module.js:327     throw err;     ^  Error: Cannot find module 'eslint'     at Function.Module._resolveFilename (module.js:325:15)     at Function.Module._load (module.js:276:25)     at Module.require (module.js:353:17)     at require (internal/module.js:12:17)     at Object.<anonymous> (C:\Users\MyUser\AppData\Roaming\Sublime Text 3\Packages\ESLint\linter.js:12:17)     at Module._compile (module.js:409:26)     at Object.Module._extensions..js (module.js:416:10)     at Module.load (module.js:343:32)     at Function.Module._load (module.js:300:12)     at Function.Module.runMain (module.js:441:10) [Finished in 0.2s with exit code 1] 
like image 743
user2692032 Avatar asked Aug 05 '16 11:08

user2692032


1 Answers

Go to "Preferences / Package Settings / ESLint / Settings - User" in the menu bar, and enter the following (file paths may vary):

{   "node_path": "/usr/local/bin",   "node_modules_path": "/usr/local/lib/node_modules" } 

Here's the GitHub page: https://github.com/polygonplanet/sublime-text-eslint. Scroll down to the "Configuring ESLint" section, it's all documented there.

like image 80
Jeremy Bernier Avatar answered Oct 31 '22 02:10

Jeremy Bernier