Nativescript-cli: TNS debug android - EMFILE: too many open files

Created on 3 Jul 2017  路  3Comments  路  Source: NativeScript/nativescript-cli

_From @briosheje on July 3, 2017 10:25_

Please, provide the details below:

Did you verify this is a real problem by searching [Stack Overflow

Yes. Several issues are not relatable to the current problem.

Tell us about the problem

Issues when compiling using local external module.

Which platform(s) does your issue occur on?

Android, didn't try in iOS yet.

Please provide the following version numbers that your issue occurs with:

  • CLI: (run tns --version to fetch it) 3.0.3
  • Cross-platform modules: (check the 'version' attribute in the
    node_modules/tns-core-modules/package.json file in your project) 3.0.1
  • Runtime(s): (look for the "tns-android" and "tns-ios" properties in the
    package.json file of your project) 3.0.1 (android)
  • Plugin(s): (look for the version number in the package.json file of your
    project) NO plugins

Please tell us how to recreate the issue in as much detail as possible.

Create an external local module, in my case it's just a module that does an HTTP Request (a "Login" module).
Add it to the package.json using "file:", like this:
"@hextra/core": "file:../condiviso/moduli/core"
run
npm install
run
tns debug android

Result:

Total time: 6.159 secs
Project successfully built.
Installing...
Successfully installed on device with identifier '005511e15e3b2504'.
Executing before-livesync hook from C:\Users\hextra\Documents\Svn\Angle\angular2\ng2angle\HextraMobileBase\hooks\before-livesync\nativescript-angular-sync.js
Transferring project files...
Multiple errors were thrown:
EMFILE: too many open files, open 'C:\Users\hextra\Documents\Svn\Angle\angular2\ng2angle\HextraMobileBase\platforms\android\src\main\assets\app\tns_modules\rxjs\operator\take.js.map'
Failed to display command help { Error: EMFILE: too many open files, open 'C:\Users\hextra\AppData\Roaming\npm\node_modules\nativescript\lib\common\commands\help.js'
    at Object.fs.openSync (fs.js:584:18)
    at Object.fs.readFileSync (fs.js:491:33)
    at Object.Module._extensions..js (module.js:579:20)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Yok.resolveDependency (C:\Users\hextra\AppData\Roaming\npm\node_modules\nativescript\lib\common\yok.js:335:13)
    at Yok.resolveByName (C:\Users\hextra\AppData\Roaming\npm\node_modules\nativescript\lib\common\yok.js:312:31)
  errno: -4066,
  code: 'EMFILE',
  syscall: 'open',
  path: 'C:\\Users\\hextra\\AppData\\Roaming\\npm\\node_modules\\nativescript\\lib\\common\\commands\\help.js' }

Further notes:
If I run the application through the VSCode NativeScript extension, I don't get the error detail and the application runs properly, but the debugger is crashing:

JS: AssetExtraction: Can't remove previously installed assets in /data/user/0/org.nativescript.HextraMobileBase/files/app
JS: AssetExtraction: Can't remove previously installed assets in /data/user/0/org.nativescript.HextraMobileBase/files/internal
# NativeScript Debugger did not start in time #
[31;1mMultiple errors were thrown:
Multiple errors were thrown:
The application org.nativescript.HextraMobileBase does not appear to be running on 005511e15e3b2504 or is not built with debugging enabled.
JS: AssetExtraction: Can't remove previously installed assets in /data/user/0/org.nativescript.HextraMobileBase/files/snapshots/armeabi-v7a

Is there code involved? If so, please share the minimal amount of code needed to recreate the problem.

See above.

_Copied from original issue: NativeScript/NativeScript#4493_

bug debug android

Most helpful comment

@rosen-vladimirov @dtopuzov Sorry, I had no time to test this until yesterday night.

I've re-delployed the app today and everything seems to be working fine now, the error somehow disappeared, thanks.

All 3 comments

Hey @briosheje ,
May I ask you to try to reproduce the same issue with latest CLI. We had some similar issues that we've resolved in our 3.1.x release.
I'm looking forward to hearing from you.

Closing due to inactivity.

@rosen-vladimirov @dtopuzov Sorry, I had no time to test this until yesterday night.

I've re-delployed the app today and everything seems to be working fine now, the error somehow disappeared, thanks.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ZMW9 picture ZMW9  路  3Comments

trodellez picture trodellez  路  3Comments

empirebattles picture empirebattles  路  3Comments

NickIliev picture NickIliev  路  3Comments

DimitarTachev picture DimitarTachev  路  3Comments