Hello!
I had recently been trying to create and delete a directory with the ipfs files-api using ipfs-core 0.2.1 that runs in the context of the latest node-js.
I created it with:
await ipfs.files.mkdir("/images")
Then i verified it was created with:
await ipfs.files.stat("/images");
and got back the following:
{"cid":{ "codec":"dag-pb", "version":0, "hash": [18,32,89,148,132,57,6,95,41,97,158,244,18,128,203,185,50,190,82,197,109,153,197,150,107,101,224,17,18,57,240,152,187,239] }, "type":"directory", "size":0, "cumulativeSize":4, "blocks":0, "withLocality":false, "mode":493 }
Thus I was assuming that the directory was created.
Now when I try to delete it with:
await ipfs.files.rm("/images", { recursive: true })
I get the following error:
TypeError: [object Object]
is not an Option Object
If I try to delete it without the options object it will tell me that I should use the “-r” option, but afaik that’s more of a console option, rather than a js-ipfs api option.
Can anyone give me some hints what I am doing wrong when trying to delete the folder?
Have a nice day
Oliver