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

license-ls does not work with npm@7 and hangs forever #20

Open
sch0rsch opened this issue Jun 26, 2021 · 2 comments
Open

license-ls does not work with npm@7 and hangs forever #20

sch0rsch opened this issue Jun 26, 2021 · 2 comments

Comments

@sch0rsch
Copy link

license-ls does not work with npm@7 and hangs forever

Using [email protected] with npm 7.19.0 does not work: it produces no output and does not terminate.

How to reproduce?

Simply run license-ls with npm@latest

Details

7.19.0

...\license-ls> set DEBUG=license-ls
...\license-ls> node cli.js --depth=0 --prod > NUL
- Analyzing  license-ls Got these options: [
  "--depth=0",
  "--prod=true",
  "--production=true",
  "--include=id,name,version,license,repository,author,homepage,dependencyLevel",
  "--csv=[object Object]",
  "--table=[object Object]",
  "--xml=[object Object]"
] +0ms
- Analyzing  license-ls The `node ls` command exited with the following code: 0 +619ms
  license-ls Total paths found: 1 +0ms
  license-ls Dependency paths: [ '7.19.0' ] +0ms
(node:16820) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, lstat '...\license-ls\7.19.0'
(Use `node --trace-warnings ...` to show where the warning was created)
(node:16820) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To term
inate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:16820) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
/ Analyzing

The spinner before Analyzing keeps spinning forever and you have to termine license-ls manually.

Error causes

The cuplrit seems to be that npm 7 changed the argument handling drastically:

...\license-ls> npm -v
6.14.13

...\license-ls> npm list --parseable --prod --depth=0 "--csv=[object Object]"
...\license-ls
...\license-ls\node_modules\cross-spawn
...\license-ls\node_modules\debug
...\license-ls\node_modules\glob
...\license-ls\node_modules\json2csv
...\license-ls\node_modules\jstoxml
...\license-ls\node_modules\lodash
...\license-ls\node_modules\ora
...\license-ls\node_modules\read-package-tree
...\license-ls\node_modules\spdx-expression-parse
...\license-ls\node_modules\spdx-license-list
...\license-ls\node_modules\table
...\license-ls\node_modules\yargs

...\license-ls>
...\license-ls>npm -v
7.19.0

...\license-ls>npm list --parseable --prod --depth=0 "--csv=[object Object]"
7.19.0

...\license-ls>

When license-ls is started with [email protected] npmList(...) returns ['7.19.0'] as package list.
This in turn leads to a Error: ENOENT which is not handled and the spinner keeps spinning.

(The hang only occurs in an interactive TTY as ora does not animate the spinners when
license-ls is started by other means)

@rubenwardy
Copy link

I can confirm this:

Analyzingnode:internal/process/promises:245
          triggerUncaughtException(err, true /* fromPromise */);
          ^

[Error: ENOENT: no such file or directory, lstat '/home/ruben/dev/web/renewedtab/7.7.6'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'lstat',
  path: '/home/ruben/dev/web/renewedtab/7.7.6'
}

@robross0606
Copy link

Is there any plan to fix this?

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

3 participants