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

No valid exports main found for '...\node_modules\uuid' #428

Closed
Leandro-Albano opened this issue Apr 29, 2020 · 11 comments
Closed

No valid exports main found for '...\node_modules\uuid' #428

Leandro-Albano opened this issue Apr 29, 2020 · 11 comments

Comments

@Leandro-Albano
Copy link

Leandro-Albano commented Apr 29, 2020

Describe the bug

Just installed version "8.0.0" and I'm experiencing the following behavior
Trying to import the lib this way
import { v4 as uuidv4 } from "uuid";

and getting
No valid exports main found for '...\node_modules\uuid'

Rolling back to "7.0.3" it works fine.

Expected behavior

The lib should work fine.

Runtime

  • OS: Windows
  • Runtime: Node.js
  • Runtime Version: 13.5
@TrySound
Copy link
Member

What do you use to transpile es modules to commonjs?

@TrySound
Copy link
Member

TrySound commented Apr 29, 2020

@ctavan FYI this is another way of providing exports
https://unpkg.com/browse/[email protected]/package.json

@Leandro-Albano
Copy link
Author

I'm using just typescript.

@TrySound
Copy link
Member

ts-node or tsc?

@TrySound
Copy link
Member

This issue looks similar ai/nanoid#206 (comment)

@Leandro-Albano
Copy link
Author

Leandro-Albano commented Apr 29, 2020

ts-node
May be similar, but it works fine on "7.0.3"

@TrySound
Copy link
Member

Check the link. Update to the latest node 13

@Leandro-Albano
Copy link
Author

Cool, thank you so much, that worked!

@ctavan
Copy link
Member

ctavan commented Apr 30, 2020

FTR: We explicitly decided not to support early 13.x versions of Node.js where the exports field of package.json behaved slightly different (see #402 (comment)).

@antoniandre
Copy link

Hi, is this resolved?
I get the same error trying to install a new package, on node version 14.4.0 and npm version 6.14.5 (latests).
release-it/release-it#674

@ctavan
Copy link
Member

ctavan commented Jun 10, 2020

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

4 participants