mock-aws-s3
mock-aws-s3 copied to clipboard
no such file or directory, scandir...
I get the error if I want to getList of empty bucket:
s3 = AWSMock.S3({Bucket: 'my-bucket'});
s3.listObjects({Bucket: 'my-bucket', Prefix: 'new-one/'}, (data)=>{
console.log(data);
});
Error: ENOENT: no such file or directory, scandir '/tmp/buckets//my-bucket'
Hi,
Maybe to late but your error is double slash between "/tmp/buckets/" and "my-bucket" When you remove one slash, it should access to /tmp/bucket/ folder on your computer :)
Maybe related, I get a similiar error when listing with a prefix that does not exist on disk
ENOENT: no such file or directory, scandir '/tmp/buckets/XHKKDXE82PH8KP/test'
/tmp/buckets/XHKKDXE82PH8KP
exists, but test
doesnt
I may have been removing the buckets dir, i make sure its there in setup now
This is because your bucket doesn't exist. You have to upload at least one file or call createBucket()
before you can run listObjects()