question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

No valid exports for `listr2/node_modules/uuid`

See original GitHub issue

Running lint-staged (using listr2 2.0.1 https://github.com/okonet/lint-staged/blob/master/package.json#L41) fails when running with the following stack:

husky > pre-commit (node v13.3.0)
internal/modules/cjs/loader.js:621
  throw e;
  ^

Error: No valid exports main found for 'project/node_modules/listr2/node_modules/uuid'
    at resolveExportsTarget (internal/modules/cjs/loader.js:618:9)
    at applyExports (internal/modules/cjs/loader.js:499:14)
    at resolveExports (internal/modules/cjs/loader.js:548:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:650:22)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:948:27)
    at Function.Module._load (internal/modules/cjs/loader.js:854:27)
    at Module.require (internal/modules/cjs/loader.js:1023:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (project/node_modules/listr2/dist/lib/task.js:9:16)
    at Module._compile (internal/modules/cjs/loader.js:1128:30) {
  code: 'MODULE_NOT_FOUND'
}
husky > pre-commit hook failed (add --no-verify to bypass)

I’ve tried removing node_modules and package-lock and re-installing but no luck 😔

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
cenk1cenk2commented, May 18, 2020

I can replace that because uuid is a bit overkill. Just had to create some random task ids even math.random should have worked but when initially I integrated it for testing, it stayed like it from that point on.

1reaction
iirojcommented, May 18, 2020

@cenk1cenk2 The package nanoid is a pretty popular option, especially if the id doesn’t have to be an official UUID: https://github.com/ai/nanoid

Read more comments on GitHub >

github_iconTop Results From Across the Web

No valid exports main found for node_modules\uuid #5381
Hi, I just updated my project using npm -update @loopback/cli and lb4 update. No errors on build but when I start I get...
Read more >
How to fix “Error: No valid exports main found for ... - Dev Genius
Recently when I was developing for a React application that I hadn't pulled from the master branch in a while, I came across...
Read more >
How do I fix my "No valid exports main found" compile error?
In my chrome and terminal, it says like this way. Failed to compile ./src/index.css (./node_modules/css-loader/dist/cjs.js??ref-- ...
Read more >
HOW TO SOLVE THE NO VALID EXPORTS ERROR IN ...
Recently while running the sequelize-cli init command, I ran into an error. The error message was something like export not found.
Read more >
How to fix “Error: No valid exports main found ... - Godwill Barasa
How to fix “Error: No valid exports main found for '/node_modules/packname by Godwill Barasa. On 12th May, as I was trying to “npm...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found