Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Error at EventEmitter ... index.js:280 #6

Closed
ndabAP opened this issue Nov 6, 2017 · 8 comments
Closed

Error at EventEmitter ... index.js:280 #6

ndabAP opened this issue Nov 6, 2017 · 8 comments

Comments

@ndabAP
Copy link

ndabAP commented Nov 6, 2017

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'test' ]
2 info using npm@5.5.1
3 info using node@v8.9.0
4 verbose run-script [ 'pretest', 'test', 'posttest' ]
5 info lifecycle docemur@0.0.0 pretest: docemur@0.0.0
6 info lifecycle docemur@0.0.0 test: docemur@0.0.0
7 verbose lifecycle docemur@0.0.0 test: unsafe-perm in lifecycle true
8 verbose lifecycle docemur@0.0.0 test: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/app/backend/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle docemur@0.0.0 test: CWD: /app/backend
10 silly lifecycle docemur@0.0.0 test: Args: [ '-c',
10 silly lifecycle 'NODE_ENV=test mocha --require babel-register test/**/*sign-in.test.js' ]
11 silly lifecycle docemur@0.0.0 test: Returned: code: 2 signal: null
12 info lifecycle docemur@0.0.0 test: Failed to exec test script
13 verbose stack Error: docemur@0.0.0 test: NODE_ENV=test mocha --require babel-register test/**/*sign-in.test.js
13 verbose stack Exit status 2
13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid docemur@0.0.0
15 verbose cwd /app/backend
16 verbose Linux 4.4.0-98-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "test"
18 verbose node v8.9.0
19 verbose npm v5.5.1
20 error code ELIFECYCLE
21 error errno 2
22 error docemur@0.0.0 test: NODE_ENV=test mocha --require babel-register test/**/*sign-in.test.js
22 error Exit status 2
23 error Failed at the docemur@0.0.0 test script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

Node.js version: 8.9.0
npm version: 5.5.1

Command:

NODE_ENV=test mocha --require babel-register test/**/*sign-in.test.js

What's important to is that I use a module that rewrites how modules are required:

module-alias

@ilearnio
Copy link

ilearnio commented Nov 6, 2017

@ndabAP What is the error exactly? I can see only stack trace (I'm author of module-alias)

@ndabAP
Copy link
Author

ndabAP commented Nov 6, 2017

npm ERR! code ELIFECYCLE
npm ERR! errno 2

All routes inside unit tests return status code 404. It works as expected outside of an unit test.

@ilearnio
Copy link

ilearnio commented Nov 6, 2017

I bet there is something more ;) Error at EventEmitter .. here at the "..." should be some info. Without knowing what exactly caused the error can't say for sure if it's caused by module-alias

@ndabAP
Copy link
Author

ndabAP commented Nov 6, 2017

This is the full error log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'test' ]
2 info using npm@5.5.1
3 info using node@v8.9.0
4 verbose run-script [ 'pretest', 'test', 'posttest' ]
5 info lifecycle docemur@0.0.0 pretest: docemur@0.0.0
6 info lifecycle docemur@0.0.0 test: docemur@0.0.0
7 verbose lifecycle docemur@0.0.0 test: unsafe-perm in lifecycle true
8 verbose lifecycle docemur@0.0.0 test: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/app/backend/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle docemur@0.0.0 test: CWD: /app/backend
10 silly lifecycle docemur@0.0.0 test: Args: [ '-c',
10 silly lifecycle 'NODE_ENV=test mocha --require babel-register test/**/*sign-in.test.js' ]
11 silly lifecycle docemur@0.0.0 test: Returned: code: 2 signal: null
12 info lifecycle docemur@0.0.0 test: Failed to exec test script
13 verbose stack Error: docemur@0.0.0 test: NODE_ENV=test mocha --require babel-register test/**/*sign-in.test.js
13 verbose stack Exit status 2
13 verbose stack at EventEmitter. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:280:16)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at EventEmitter.emit (events.js:214:7)
13 verbose stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at emitTwo (events.js:126:13)
13 verbose stack at ChildProcess.emit (events.js:214:7)
13 verbose stack at maybeClose (internal/child_process.js:925:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
14 verbose pkgid docemur@0.0.0
15 verbose cwd /app/backend
16 verbose Linux 4.4.0-98-generic
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "test"
18 verbose node v8.9.0
19 verbose npm v5.5.1
20 error code ELIFECYCLE
21 error errno 2
22 error docemur@0.0.0 test: NODE_ENV=test mocha --require babel-register test/**/*sign-in.test.js
22 error Exit status 2
23 error Failed at the docemur@0.0.0 test script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

Sorry for bothering you if it's not caused by your module. My unit test worked some weeks ago and I switched to your great module. But now they fail ;)

@ndabAP
Copy link
Author

ndabAP commented Nov 6, 2017

Oh my god, I'm so sorry. I imported the wrong app.js. Everything is okay! Sorry for taking your time.

@ndabAP ndabAP closed this as completed Nov 6, 2017
@ilearnio
Copy link

ilearnio commented Nov 6, 2017

No problems, glad you solved it

@toanvc
Copy link

toanvc commented Jun 8, 2018

Hi @ndabAP ,I got the same problem. How did you solve? Thank you

@RoValentim
Copy link

Oh my god, I'm so sorry. I imported the wrong app.js. Everything is okay! Sorry for taking your time.

How you solved? I have the same issue...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants