Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wallaby hanging #760

Closed
zpydee opened this issue Aug 25, 2016 · 9 comments
Closed

Wallaby hanging #760

zpydee opened this issue Aug 25, 2016 · 9 comments

Comments

@zpydee
Copy link

zpydee commented Aug 25, 2016

Issue description or question

Hi,

I've got a node project and node has started hanging, this is the first excerpt from the walaby console:

[Info] Started Wallaby.js Core v1.0.282
[Error] Error: spawn /Users/zpydee/.nvm/versions/node/v6.3.0/bin/node EMFILE
[Error]   at exports._errnoException (util.js:1008:11)
[Error]   at Process.ChildProcess._handle.onexit (internal/child_process.js:182:32)
[Error]   at onErrorNT (internal/child_process.js:348:16)
[Error]   at _combinedTickCallback (internal/process/next_tick.js:74:11)
[Error]   at process._tickCallback (internal/process/next_tick.js:98:9)

The process eventually runs out of memory after several attempts.

I've recently added the following before_install to my .travis.yml file to prevent travis from not being able to run a post-install on nested package.json files and not sure if this could be causing the EMFILE:

before_install:
  - PATH=${PATH//:\.\/node_modules\/\.bin/}

Any guidance would be greatly appreciated. My tests are passing in mocha.

thanks,
Dave

Wallaby.js configuration file

stock standard...

module.exports = function (w) {

  return {
    files: [
      { pattern: 'src/**/*.js', load: true },
      { pattern: 'src/**/*.spec.js', ignore: true }
    ],

    tests: [
      { pattern: 'src/**/*.spec.js', load: true }
    ],

    env: {
      type: 'node'
    },

  };
};

Code editor or IDE name and version

Visual Studio Code v1.4.0

OS name and version

OSX

@ArtemGovorov
Copy link
Member

I'm not sure if it's wallaby specific issue, have you seen/tried this: sindresorhus/gulp-imagemin#10 (comment)?

@ArtemGovorov
Copy link
Member

Actually this is probably be more helpful as from what I read ulimit is only the the current terminal session.

@zpydee
Copy link
Author

zpydee commented Aug 25, 2016

hmmmm, increasing ulimit no helping

@ArtemGovorov
Copy link
Member

Looks like ulimit is only the the current terminal session, did you try the suggestion from this answer? Also, perhaps try killing all node processes/rebooting to see if it helps.

@zpydee
Copy link
Author

zpydee commented Aug 25, 2016

issue actually seems related to my post-install script somehow:

"postinstall" : "find ./src/* -maxdepth 5 -name package.json -execdir npm install \\;",

its still running, but if I set it lower than 5, it runs happily but the wallaby can't find lib dependencies for child projects..

i'll keep on investigating, but i'm gonna close this issue for now...

@zpydee zpydee closed this as completed Aug 25, 2016
@ArtemGovorov
Copy link
Member

Thanks for the update, perhaps this could help for resolving dependencies for child projects: https://wallabyjs.com/docs/integration/node.html#node-modules-in-subfolder

@zpydee zpydee reopened this Aug 25, 2016
@zpydee
Copy link
Author

zpydee commented Aug 25, 2016

thanks, that suggestion was on the money - happy to have my coloured dots back :-)

just for sake of clarity, I added:

process.env.NODE_PATH += path.delimiter + path.join(w.localProjectDir, 'src/lib/utils/encryption', 'node_modules');

to point to my encryption library. am I correct in assuming I'd repeat for each child project that has its own node_modules?

@ArtemGovorov
Copy link
Member

am I correct in assuming I'd repeat for each child project that has its own node_modules?

Correct. This, or, given that wallaby config is essentially a node app, you can write a small function to recursively walk your folder structure and add found node_modules folders to the process.env.NODE_PATH automatically (may make sense if you have a lot of child projects).

@zpydee
Copy link
Author

zpydee commented Aug 25, 2016

thanks as always for your prompt and very helpful assistance!

@zpydee zpydee closed this as completed Aug 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants