polygonplanet / sublime-text-eslint

ESLint any JavaScript file in Sublime Text
24 stars 7 forks source link

CLIEngine is not a constructor error #28

Closed johnmorsey007 closed 2 years ago

johnmorsey007 commented 2 years ago

I am running the latest build of Sublime - Build 4121 and eslint - v8.2.0

I'm getting the error below. I followed the simple two step install process on this github. I installed eslint globally

npm install -g eslint

and then installed the sublime eslint package - v5.0.4

I am trying to run eslint in sublime by right clicking and selecting eslint for a particular file.

When this did not work I added settings to explicitly point to node and node_modules as seen here which had no effect.

I also added a config file and let sublime know. My configuration in sublime looks like this:

{
  "node_path": "/usr/local/bin",
  "node_modules_path": "/usr/local/lib/node_modules",
  "config_file": "/Users/c/top/ll/.eslintrc"
}

I have verified eslint is working correctly from the command line.

eslint myfile

works fine.

/Users/c/Library/Application Support/Sublime Text 3/Packages/ESLint/linter.js:29
var cli = new CLIEngine(options);
          ^

TypeError: CLIEngine is not a constructor
    at Object.<anonymous> (/Users/c/Library/Application Support/Sublime Text 3/Packages/ESLint/linter.js:29:11)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:12)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
    at internal/main/run_main_module.js:17:47
[Finished in 235ms with exit code 1]
[cmd: ['node', '/Users/c/Library/Application Support/Sublime Text 3/Packages/ESLint/linter.js', '/Users/c/top/ll/a-toy/0-test.js', '/usr/local/lib/node_modules', '']]
[dir: /Users/c/top/ll/a-toy]
[path: /Applications/Sublime Text.app/Contents/SharedSupport/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin]
polygonplanet commented 2 years ago

@johnmorsey007 Thank you for the detailed report. The CLIEngine problem has been solved by #29 patch.