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

import-sort-cli throws ELIFECYCLE #21

Closed
2manyvcos opened this issue Jun 9, 2017 · 3 comments
Closed

import-sort-cli throws ELIFECYCLE #21

2manyvcos opened this issue Jun 9, 2017 · 3 comments

Comments

@2manyvcos
Copy link

Hello there,

I get error code 47 (ELIFECYCLE) when trying to sort my codebase.

Here's the log:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs',
1 verbose cli   '/usr/bin/npm',
1 verbose cli   'run',
1 verbose cli   'optimize:imports',
1 verbose cli   '--verbose' ]
2 info using npm@4.2.0
3 info using node@v7.10.0
4 verbose run-script [ 'preoptimize:imports',
4 verbose run-script   'optimize:imports',
4 verbose run-script   'postoptimize:imports' ]
5 info lifecycle Project@0.0.1~preoptimize:imports: Project@0.0.1
6 silly lifecycle Project@0.0.1~preoptimize:imports: no script for preoptimize:imports, continuing
7 info lifecycle Project@0.0.1~optimize:imports: Project@0.0.1
8 verbose lifecycle Project@0.0.1~optimize:imports: unsafe-perm in lifecycle true
9 verbose lifecycle Project@0.0.1~optimize:imports: PATH: /usr/lib/node_modules/npm/bin/node-gyp-bin:/home/aaron/Projekte/fleet-management/ui/node_modules/.bin:/home/aaron/bin:/home/aaron/.local/bin:/home/aaron/bin:/home/aaron/.local/bin:/home/aaron/bin:/home/aaron/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
10 verbose lifecycle Project@0.0.1~optimize:imports: CWD: /home/aaron/Projekte/fleet-management/ui
11 silly lifecycle Project@0.0.1~optimize:imports: Args: [ '-c', 'import-sort ./app' ]
12 silly lifecycle Project@0.0.1~optimize:imports: Returned: code: 47  signal: null
13 info lifecycle Project@0.0.1~optimize:imports: Failed to exec optimize:imports script
14 verbose stack Error: Project@0.0.1 optimize:imports: `import-sort ./app`
14 verbose stack Exit status 47
14 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/lib/utils/lifecycle.js:279:16)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at EventEmitter.emit (events.js:194:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/lib/utils/spawn.js:40:14)
14 verbose stack     at emitTwo (events.js:106:13)
14 verbose stack     at ChildProcess.emit (events.js:194:7)
14 verbose stack     at maybeClose (internal/child_process.js:899:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)
15 verbose pkgid Project@0.0.1
16 verbose cwd /home/aaron/Projekte/fleet-management/ui
17 error Linux 4.8.0-46-generic
18 error argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "optimize:imports" "--verbose"
19 error node v7.10.0
20 error npm  v4.2.0
21 error code ELIFECYCLE
22 error errno 47
23 error Project@0.0.1 optimize:imports: `import-sort ./app`
23 error Exit status 47
24 error Failed at the Project@0.0.1 optimize:imports script 'import-sort ./app'.
24 error Make sure you have the latest version of node.js and npm installed.
24 error If you do, this is most likely a problem with the Project package,
24 error not with npm itself.
24 error Tell the author that this fails on your system:
24 error     import-sort ./app
24 error You can get information on how to open an issue for this project with:
24 error     npm bugs Project
24 error Or if that isn't available, you can get their info via:
24 error     npm owner ls Project
24 error There is likely additional logging output above.
25 verbose exit [ 47, true ]
@renke
Copy link
Owner

renke commented Jun 19, 2017

Hi @aaronburmeister

I assume you using import-sort through a script in your package.json (that where the ELIFECYCLE comes from I think). Can you try to run import-sort and see if an error still occurs? – The trace you sent is not really help.

@2manyvcos
Copy link
Author

Hello again, thanks for your response.

I figured it out:
I didn't notice that the script returns the number of sorted files as return code, so I thought 47 was an error code.

Would you mind adding a note on the return value to the help page or the documentation?

renke added a commit that referenced this issue Jun 19, 2017
This fixes #21.

Thanks for your support!
@renke renke closed this as completed Jun 19, 2017
@2manyvcos
Copy link
Author

Thank you. 👍

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