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

nanoid broken in listr2 dependency #870

Closed
salolivares opened this issue May 19, 2020 · 7 comments
Closed

nanoid broken in listr2 dependency #870

salolivares opened this issue May 19, 2020 · 7 comments

Comments

@salolivares
Copy link

salolivares commented May 19, 2020

Description

Similarly to #867, I'm seeing errors running lint-staged@10.2.4. This issue seems to stem from the listr2 dependency.

Issue is fixed by rolling back to lint-staged@10.2.2.

Debug Logs

Fresh install of lint-staged yields the following:

$ ./node_modules/.bin/lint-staged
internal/modules/cjs/loader.js:628
  throw e;
  ^
Error: No valid exports main found for 'REDACTED/node_modules/nanoid'
    at resolveExportsTarget (internal/modules/cjs/loader.js:625:9)
    at applyExports (internal/modules/cjs/loader.js:502:14)
    at resolveExports (internal/modules/cjs/loader.js:551:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:657:22)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:960:27)
    at Function.Module._load (internal/modules/cjs/loader.js:855:27)
    at Module.require (internal/modules/cjs/loader.js:1033:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (REDACTED/node_modules/listr2/dist/lib/task.js:8:18)
    at Module._compile (internal/modules/cjs/loader.js:1144:30) {
  code: 'MODULE_NOT_FOUND'
}

Environment

  • OS: macOS Catalina 10.15
  • Node.js: v13.6.0
  • lint-staged: 10.2.4
@iiroj
Copy link
Member

iiroj commented May 20, 2020

We should probably use fixed versions for dependencies. Let me open an issue over at https://github.com/cenk1cenk2/listr2

@iiroj
Copy link
Member

iiroj commented May 20, 2020

@salolivares can I ask if upgrading to Node.js 14 is an option for you?

14 is on track to being the next LTS release, so 13 will be pretty short-lived. Seeing how this issue affected two dependencies of one of our dependencies, it seems like an issue specifically in 13.

@iiroj
Copy link
Member

iiroj commented May 20, 2020

Actually, it seems nanoid has a dependency of Node.js "^10 || ^12 || >=13.7", as seen here: https://github.com/ai/nanoid/blob/master/package.json#L19. This would imply that listr2 also doesn't support 13.6.0.

I wonder if we should bump this for lint-staged as well? Thoughts, @okonet?

@okonet
Copy link
Collaborator

okonet commented May 20, 2020

Yeah sure why not?

@iiroj
Copy link
Member

iiroj commented May 20, 2020

I opened #871 to work around this issue, but let's also hope listr2 fixes this upstream.

@iiroj
Copy link
Member

iiroj commented May 20, 2020

This probably fixed by reinstalling now that lisrt2 rolle back to uuid v7 in v2.0.4.

@iiroj iiroj closed this as completed May 20, 2020
@salolivares
Copy link
Author

@salolivares can I ask if upgrading to Node.js 14 is an option for you?

14 is on track to being the next LTS release, so 13 will be pretty short-lived. Seeing how this issue affected two dependencies of one of our dependencies, it seems like an issue specifically in 13.

Yep, I've reverted to the latest LTS (v12) and got it to work. Thanks for the help guys.

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

No branches or pull requests

3 participants