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

‼️ 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 #7816

Closed
ralovely opened this issue May 6, 2020 · 6 comments · Fixed by #7887
Assignees
Labels
bug This issue is a bug. in-progress This issue is being actively worked on. p1 package/tools Related to AWS CDK Tools or CLI

Comments

@ralovely
Copy link

ralovely commented May 6, 2020

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       
+ [email protected]
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

@ralovely ralovely added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels May 6, 2020
@mertsaygi
Copy link

My node is v12.14.1 and npm is 6.13.4 than i do not have this issue. By the way, my teammate has node v13.5.0 and npm 6.13.4 and he has similar issue with you. I think it is related with node version. Can you downgrade it while resolving this issue?

@mertsaygi
Copy link

When i upgrade my node version to v13.5.0 i got same error

@mertsaygi
Copy link

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:
uuidjs/uuid#428

@spg
Copy link
Contributor

spg commented May 6, 2020

Upgrading to Node 14.2.0 solved the problem for me

@SomayaB SomayaB added the package/tools Related to AWS CDK Tools or CLI label May 6, 2020
@raphael-riel
Copy link
Contributor

raphael-riel commented May 6, 2020

Thanks @spg !
Upgrading Node to v14.1.0 using brew did fix the problem for me too.

@shivlaks shivlaks added p1 and removed needs-triage This issue or PR still needs to be triaged. labels May 6, 2020
@shivlaks shivlaks pinned this issue May 6, 2020
@shivlaks shivlaks changed the title UUID import fails in 1.37.0 ‼️ NOTICE: cannot install aws-cdk with Node 13.x - Error: No valid exports main found - UUID import fails in 1.37.0 May 6, 2020
@shivlaks shivlaks changed the title ‼️ NOTICE: cannot install aws-cdk with Node 13.x - Error: No valid exports main found - UUID import fails in 1.37.0 ‼️ 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 May 6, 2020
@shivlaks
Copy link
Contributor

shivlaks commented May 6, 2020

Affected versions 13.0.0 to 13.6.0

Node13 is in Maintenance LTS and will be hitting EOL on 2020-06-01

shivlaks added a commit that referenced this issue May 9, 2020
@SomayaB SomayaB added the in-progress This issue is being actively worked on. label May 11, 2020
@mergify mergify bot closed this as completed in #7887 May 13, 2020
mergify bot pushed a commit that referenced this issue May 13, 2020
This is a follow-up to the recent issue we had where `uuid` had bumped up versions and that included changes that affected earlier version of node `13.x`. Several of our dependencies do not support odd numbered releases. Rather than be restrictive, only including the affected versions for now.

Made some slight modifications to the `README` and `CONTRIBUTING` to plug a recommendation to use LTS versions of Node.

Closes #7816
@shivlaks shivlaks unpinned this issue May 21, 2020
karupanerura pushed a commit to karupanerura/aws-cdk that referenced this issue May 22, 2020
This is a follow-up to the recent issue we had where `uuid` had bumped up versions and that included changes that affected earlier version of node `13.x`. Several of our dependencies do not support odd numbered releases. Rather than be restrictive, only including the affected versions for now.

Made some slight modifications to the `README` and `CONTRIBUTING` to plug a recommendation to use LTS versions of Node.

Closes aws#7816
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. in-progress This issue is being actively worked on. p1 package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants