How to solve The file uses a storage provider that is read-only

I want to rename an image, but I get the error:The file uses a storage provider that is read-only.
Here is My code:

const fs = require("uxp").storage.localFileSystem;
const pluginFolder = await fs.getPluginFolder();
const psd = await pluginFolder.getEntry('test.psd');

const currentDocument = await;

await currentDocument.saveAs.jpg(psd,{ quality:12 },true)

const jpg = await pluginFolder.getEntry('test.jpg');

const img = await pluginFolder.getEntry('img');

await jpg.moveTo(img,{newName:'11.jpg'})