ESLint-Formatter icon indicating copy to clipboard operation
ESLint-Formatter copied to clipboard

Cannot find module

Open caliangxie opened this issue 8 years ago • 5 comments

When I try to run it, I get an error popup saying that the module 'C:\Users\Me' cannot be found. I have eslint installed and I can run it just fine on the command line.

caliangxie avatar Jul 07 '17 11:07 caliangxie

You should check the plugin config and see if all the paths in there are correct. You should enable debug: true in the config and check the console for error messages.

AoDev avatar Jul 12 '17 14:07 AoDev

Sorry for the very late reaction.

I tried to see whether I could figure out the issue again and this time(how did I not notice this last time) I noticed that my username folder was cut in half.

The thrown error says that module 'C:\Users\A' cannot be found but my name is 'A B' so perhaps the space is causing the issue?

caliangxie avatar Sep 30 '17 09:09 caliangxie

The thrown error says that module 'C:\Users\A' cannot be found but my name is 'A B' so perhaps the space is causing the issue?

This seems likely. It'd be worth checking if running subprocess.Popen('C:\Users\A B\...\path\to\eslint') works as expected.

skeggse avatar May 19 '20 22:05 skeggse

I was getting module_not_found issues, in my case I think it's because I'm mounting a remote filesystem via SFTP using GVFS on Linux. I think there's some issue with following symlinks, but never confirmed that.

I fixed it by copying the eslint file into my home directory and ensuring I only ever use local eslint stuff in Sublime:

{
	"local_eslint_path": {
		"linux": ""
	},
	"eslint_path": {
		"linux": "/home/username/node_modules/.bin/eslint",
		"config_path": "/home/username/.eslintrc.custom.json"
	},
	"extra_args": ["--no-eslintrc"]
}

That got rid of the error, but I noticed it's not actually fixing any kind of formatting now... but hopefully this helps someone get further.

sricks avatar Mar 19 '21 18:03 sricks

Silly me, this is at least partly because config_path is not part of eslint_path, it's a top-level option. This allows it to format:

{
	"local_eslint_path": {
		"linux": ""
	},
	"eslint_path": {
		"linux": "/home/username/node_modules/.bin/eslint"
	},
	"config_path": "/home/username/.eslintrc.custom.json",
	"extra_args": ["--no-eslintrc"]
}

It's not formatting everything I would expect, but I haven't touched that eslint file in a while, and it did change at least one thing. So I think it's working this way.

sricks avatar Mar 19 '21 18:03 sricks