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.

Unable to run CDK local Error: Cannot find module 'aws-cdk/lib/api/aws-auth/sdk-provider'

See original GitHub issue

Trying to run cdklocal (having used npm to install it) and get the following error:

node:internal/modules/cjs/loader:927
  throw err;
  ^

Error: Cannot find module 'aws-cdk/lib/api/aws-auth/sdk-provider'
Require stack:
- /usr/local/lib/node_modules/aws-cdk-local/bin/cdklocal
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/aws-cdk-local/bin/cdklocal:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/local/lib/node_modules/aws-cdk-local/bin/cdklocal' ]
}

Note: I’m using cdk with python code (but tried running cdklocal in an empty directory as well).

Issue Analytics

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

github_iconTop GitHub Comments

8reactions
SimonLdjcommented, Jul 6, 2021

got similar issue:

Error: Cannot find module 'aws-cdk/node_modules/cdk-assets/lib/private/handlers/files'

with "aws-cdk": "1.111.0" & "aws-cdk-local": "1.65.5" but with "aws-cdk-local": "1.65.4" all looks good

1reaction
recklessYellocommented, Jul 10, 2021

Please note I had a similar issue with aws-cdk-local version 1.65.5 My error was cdklocal --version
Error Cannot find module diff

Taking @SimonLdj advice solved the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Solving Cannot find Module Error in AWS CDK | bobbyhadz
In order to solve the Cannot find Module Error we have to npm install all CDK packages we are importing. If it doesn't...
Read more >
AWS CDK: Cannot find module 'typescript' - Stack Overflow
I have faced similar issue and my build was not working. However, my installing ts-node as global seems to solve the problem
Read more >
Troubleshooting common AWS CDK issues
When deploying my AWS CDK stack, I receive a NoSuchBucket error ... npx aws-cdk runs the local version of the AWS CDK Toolkit...
Read more >
@aws-cdk/core - npm
AWS Cloud Development Kit Core Library. Latest version: 1.186.1, last published: 15 hours ago. Start using @aws-cdk/core in your project by running `npm...
Read more >
awslabs/aws-cdk - Gitter
CDK deploy runs smoothly, but at runtime I get a cannot find module nconf/store/argv error. My code is working well, 'cause no test...
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