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

shell.exec('npm pack') painfully slow #885

Closed
pfms84 opened this issue Aug 22, 2018 · 3 comments
Closed

shell.exec('npm pack') painfully slow #885

pfms84 opened this issue Aug 22, 2018 · 3 comments
Labels
exec

Comments

@pfms84
Copy link

@pfms84 pfms84 commented Aug 22, 2018

Node version (or tell us if you're using electron or some other framework):

10.9.0

ShellJS version (the most recent version/Github branch you see the bug on):

0.8.2

Operating system:

Windows 10

Description of the bug:

With the version 6 of NPM, shell.exec('npm pack') or shell.exec('npm publish') became painfully slow.

Example ShellJS command to reproduce the error:

console.time('execution-time');
if (shell.exec(`npm pack`).code !== 0) {
    process.exit(-1);
}
console.timeEnd('shell.exec(\'npm pack\')'); // shell.exec('npm pack'): 189658.260ms
@nfischer nfischer added the exec label Aug 22, 2018
@nfischer
Copy link
Member

@nfischer nfischer commented Aug 22, 2018

With the version 6 of NPM, shell.exec('npm pack') or shell.exec('npm publish') became painfully slow.

Hmmm this wasn't slow with npm@v5? Can you provide timing values for v5 so we can compare?

Can you also give us timing values for running npm pack in the terminal?

@pfms84
Copy link
Author

@pfms84 pfms84 commented Aug 23, 2018

with npm@v5, 2111.266ms for the same folder.
with npm@v6, npm pack runs almost instantly if used directly, but I noticed something strange and probably the problem isn't related with shelljs, but with npm itself.
Running Measure-Command { npm pack } took 188976,3689ms, which is basically the same time it took with shelljs.
Ok, I think you can close this issue, the problem seems to be with npm itself (or maybe node.js). npm starts 2 node.js processes and they keep running for ages.

@nfischer
Copy link
Member

@nfischer nfischer commented Aug 24, 2018

Closing for now, but let me know if there's anything we need to do on the shelljs-side. Thanks for further investigation!

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

No branches or pull requests

2 participants