aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.51k stars 3.86k forks source link

(aws-cdk): (cdk deploy failed with Error: EACCES: permission denied, scandir ) #27610

Closed maymayman closed 3 months ago

maymayman commented 11 months ago

Describe the bug

I am trying to deploy CloudFormation templates using CDK But receive an Error EACCES: permission denied, scandir

Expected Behavior

Can deploy successful

Current Behavior

node:fs:1527
  handleErrorFromBinding(ctx);
  ^

Error: EACCES: permission denied, scandir 'C:/Users/Phat/Desktop/workspace/resize-image-service/cdk.out/asset.a4d282274929658deaa9944f80a716703650e903f801727100f56ab94049e35a/nodejs/node_modules/.bin/prebuild-install'
    at Object.readdirSync (node:fs:1527:3)
    at GlobSync._readdir (\node_modules\aws-cdk\lib\index.js:431:848900)
    at GlobSync._readdirInGlobStar (\node_modules\aws-cdk\lib\index.js:431:848291)        
    at GlobSync._readdir (\node_modules\aws-cdk\lib\index.js:431:848723)
    at GlobSync._processGlobStar (\node_modules\aws-cdk\lib\index.js:431:849803)
    at GlobSync._process (\node_modules\aws-cdk\lib\index.js:431:846756)
    at GlobSync._processGlobStar (\npm\node_modules\aws-cdk\lib\index.js:431:850312)
    at GlobSync._process (\node_modules\aws-cdk\lib\index.js:431:846756)
    at GlobSync._processGlobStar (\node_modules\aws-cdk\lib\index.js:431:850312)
    at GlobSync._process (\aws-cdk\lib\index.js:431:846756) {
  errno: -4092,
  syscall: 'scandir',
  code: 'EACCES',
  path: 'Desktop/workspace/resize-image-service/cdk.out/asset.a4d282274929658deaa9944f80a716703650e903f801727100f56ab94049e35a/nodejs/node_modules/.bin/prebuild-install'
}

Reproduction Steps

cdk deploy

Possible Solution

No response

Additional Information/Context

No response

CDK CLI Version

2.102.0

Framework Version

No response

Node.js Version

v18.18.2

OS

Window 10 Pro x64

Language

TypeScript

Language Version

typescript@4.9.5

Other information

No response

pahud commented 11 months ago

Looks like it's a local OS filesystem permission issue. Unfortunately I have no idea about that off the top of my head. Does it always happen when you create a new fresh cdk project and deploy that?

github-actions[bot] commented 11 months ago

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

maymayman commented 10 months ago

@pahud I already resolved this issue in macOS but still have an error in Window unlucky it always happens even though I installed CDK to global or refreshed cdk project

Richardmbs12 commented 10 months ago

Same issue here since i installed the latest cdk version - 2.108 also on windows

tharikrizan-praedico commented 9 months ago

I am having the same issue

cdk version : 2.102.0

ashishdhingra commented 3 months ago

@maymayman I'm unsure if this is a CDK tooling issue. Could you try running command prompt in Administrator mode and try again?

github-actions[bot] commented 3 months ago

This issue has not received a response in a while. If you want to keep this issue open, please leave a comment below and auto-close will be canceled.

adam-mah commented 2 months ago

Experiencing the same issue here RuntimeError: EACCES: permission denied, lstat