Sublime Forum

I am getting an error when I try to edit some code I cloned from my companies git repo

#1

I am getting an error when I try to edit some code I cloned from my companies git repo. This is the error I am getting and I do not know why I am getting it or what it really means. Is there anyway you guys could give me some clarification on this error?

Failed to start server:

fs.js:432
return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
^
Error: EMFILE, too many open files ‘/Users/acltc/Library/Application Support/Sublime Text 3/Packages/Meteor Autocomplete (TernJS)/node_modules/tern/defs/ecma5.json’
at Object.fs.openSync (fs.js:432:18)
at Object.fs.readFileSync (fs.js:289:15)
at readJSON (/Users/acltc/Library/Application Support/Sublime Text 3/Packages/Meteor Autocomplete (TernJS)/node_modules/tern/bin/tern:72:17)
at findDefs (/Users/acltc/Library/Application Support/Sublime Text 3/Packages/Meteor Autocomplete (TernJS)/node_modules/tern/bin/tern:126:26)
at startServer (/Users/acltc/Library/Application Support/Sublime Text 3/Packages/Meteor Autocomplete (TernJS)/node_modules/tern/bin/tern:241:14)
at Object. (/Users/acltc/Library/Application Support/Sublime Text 3/Packages/Meteor Autocomplete (TernJS)/node_modules/tern/bin/tern:232:20)
at Module._compile (module.js:456:26)
at Object.Module._extensions…js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)

0 Likes

#2

What do you do before you get this error? I’m not sure it’s a problem coming from Sublime Text.

0 Likes

#3

When I get this error, I am writing JSX code in my sublime text editor. What is you hunch about what this relates to?

0 Likes

#4

And, do you build? Or is it log in the Sublime Text’s console?

This doesn’t look like an error coming from Sublime Text, but from your program.Actually, sorry, it’s coming from ST:

Error: EMFILE, too many open files '/Users/acltc/Library/Application Support/Sublime Text 3/Packages/Meteor Autocomplete (TernJS)/node_modules/tern/defs/ecma5.json'

With the error message, I’m guessing that you have too many tabs open (?) I’ve never used this plugin before, so I’m just guessing.

0 Likes

#5

I initially thought that as well but I only have the one sublime tab open

0 Likes

#6

That error is indicative of bumping against the process limit on the number of open files that can be maintained at one time. That is something that is imposed on you by the operating system, and not by Sublime text itself.

Looks like you’re doing something NodeJS related (or rather, some plugin that you’re using is). It’s NodeJS that’s throwing the error. I don’t think it’s uncommon for NodeJS to creat/use e large numbers of files.

On OSX/Linux you can run a command such as this from a terminal to tell you how many open files you’re allowed to have at once:

tmartin:dart:~/> ulimit -n
1024

On my Mac, the default limit is 256:

tmartin:tmac:~> ulimit -n
256

In order to fix the problem you need to increase that limit. Possibly adding a line such as the following to your .bashrc or .bash_profile may accomplish that (the number can be increased, but don’t go crazy with it):

ulimit -n 1024

I’ve never tried to fiddle that value on OSX before so I don’t know if there is some more “Apple” way to accomplish the task if that does not work. It may not work if the build system in your plugin doesn’t use a shell to execute or without a reboot first, for example.

2 Likes

#7

boom. so far this has worked. https://jaredbarriere.wordpress.com/2016/08/02/sublime-text-3-meteor-auto-complete-ternjs/

I will update if it continues to give me the error

1 Like