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.

‼️ NOTICE: cannot install `aws-cdk` with Node v13.0.0 - v13.6.0 - Error: No valid exports main found - UUID import fails in 1.37.0

See original GitHub issue

Hello.

After upgrading to 1.37.0, I ran into an error:

Error: No valid exports main found for '~/.nvm/versions/node/v13.2.0/lib/node_modules/aws-cdk/node_modules/uuid'
    at resolveExportsTarget (internal/modules/cjs/loader.js:611:9)
    at applyExports (internal/modules/cjs/loader.js:492:14)
    at resolveExports (internal/modules/cjs/loader.js:541:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:643:22)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:941:27)
    at Function.Module._load (internal/modules/cjs/loader.js:847:27)
    at Module.require (internal/modules/cjs/loader.js:1016:19)
    at require (internal/modules/cjs/helpers.js:69:18)
    at Object.<anonymous> (~/.nvm/versions/node/v13.2.0/lib/node_modules/aws-cdk/lib/api/deploy-stack.ts:3:1)
    at Module._compile (internal/modules/cjs/loader.js:1121:30)

Reproduction Steps

➜  ~ npm install aws-cdk -g       
+ aws-cdk@1.37.0
updated 10 packages in 2.559s
➜  ~ cdk init --language javascript
Error: No valid exports main found for '~/.nvm/versions/node/v13.2.0/lib/node_modules/aws-cdk/node_modules/uuid'
    at resolveExportsTarget (internal/modules/cjs/loader.js:611:9)
    at applyExports (internal/modules/cjs/loader.js:492:14)
    at resolveExports (internal/modules/cjs/loader.js:541:12)
    at Function.Module._findPath (internal/modules/cjs/loader.js:643:22)
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:941:27)
    at Function.Module._load (internal/modules/cjs/loader.js:847:27)
    at Module.require (internal/modules/cjs/loader.js:1016:19)
    at require (internal/modules/cjs/helpers.js:69:18)
    at Object.<anonymous> (~/.nvm/versions/node/v13.2.0/lib/node_modules/aws-cdk/lib/api/deploy-stack.ts:3:1)
    at Module._compile (internal/modules/cjs/loader.js:1121:30)

Environment

  • CLI Version : 1.37.0
  • Framework Version: 1.37.0
  • OS :MacOS 10.15.4
  • Language : JS

Other

From looking around, I think this is tied to the upgrade of uuid to v 8.0.0 but v8.0 of uuid has a breaking change where the generic uuid module is not exported anymore, yet, it is still used in CDK, at least here

Thank you.


This is 🐛 Bug Report

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
mertsaygicommented, May 6, 2020

aws-cdk uses uuid library. The library has an resolved GitHub issue. The solution is updating node version from v13.x.x to latest v13 which is v13.14.0. When i updated to that version my node, i resolved this issue: Related link: https://github.com/uuidjs/uuid/issues/428

1reaction
spgcommented, May 6, 2020

Upgrading to Node 14.2.0 solved the problem for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unknown error: Error: No valid exports main found for src\main ...
As I know that Nodejs version v13 had some issues. Use v12.16.3 and it's working. Either use latest v14.2.0 or official LTS v12.16.3....
Read more >
aws-cdk | Yarn - Package Manager
The AWS Cloud Development Kit (AWS CDK) is an open-source software development framework to define cloud infrastructure in code and provision it through...
Read more >
Troubleshooting common AWS CDK issues
This topic describes how to troubleshoot the following issues with the AWS CDK. After updating the AWS CDK, code that used to work...
Read more >
[error:flutter/runtime/dart_vm_initializer.cc(41)] unhandled ...
When registering a secondary app in main, hot restart breaks for the whole app (i.e. if you await the initialization).
Read more >
https://www.johnsoncontrols.com/buildings/legal/di...
These licenses may require their source code to be made available to ... json-parse-better-errors 1.0.2, MIT License ... uid-number 0.0.6, ISC License.
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