Error/Help :: Error, something like a LOCK file which is temporarily unavailable

First i want to add file to ipfs and retrieve CID, so i did by this:-

const IPFS = require("ipfs");

async function main() {
  const node = await IPFS.create();
  const version = await node.version();

  console.log("Version:", version.version);

  const fileAdded = await node.add({
    path: "FILE_PATH",
    content: "DESCRIPTION",
  });

  console.log("Added file:", fileAdded.path, fileAdded.cid);

}

main(); 

then i want create a json file using CID from ipfs and meta information of CID and then upload the JSON to IPFS and retrieve the CID. So i was trying this:-
Read the file into a buffer and use ipfs-add to send the file to ipfs.
We will get the File-CID which we will include when you create the json-object.
Then Read the json-object into a buffer and add that buffer.
It will return the JSON CID.

by this:-

const IPFS = require("ipfs");

async function main() {
  const node = await IPFS.create();
  const version = await node.version();

 console.log("Version:", version.version);

  const fileAdded = await node.add({
    path: "/home/dungexn/Pictures/1.png",
    content: "Image",
  });

 // console.log("Added file:", fileAdded.path, fileAdded.cid);
  // ...
  const jsonAdded = await node.add({
    cid: fileAdded.cid ,
    metadata: {
      version: fileAdded.cid.version,
      code: fileAdded.cid.code,
    },
  }); 


  

var dictstring = JSON.stringify(fileAdded);

var fs = require('fs');

fs.writeFile("cid.JSON", dictstring, function(err, result) {
    if(err) console.log('error', err);
});

var dictstring = JSON.stringify(jsonAdded);

var fs = require('fs');

fs.writeFile("CID.JSON", dictstring, function(err, result) {
    if(err) console.log('error', err);
});



const json_data = require('./cid.JSON');


//console.log(json_data)

// fs.readFile(json_data, 'utf8', function (err, data) {
//   try {
//    // data = JSON.parse(data)
//     // for (let i in data){
//     // console.log('Name:',data[i])
//     // }
//    // console.log(data)


//   } catch (e) {
//     // Catch error in case file doesn't exist or isn't valid JSON
//   }
// });






}

main();

the i started getting this error, and i did reinstall ipfs but still:-

Any help in the process or the working or the code will be very helpful for me. Many thanks

It’s solved, the error was in my code

May I know where is the error in your code and how did you solve that?
Thank you!

so update npm in your project and when i restart my system, the code works(i was terminating the process with ctrl+z rather than ctrl+c, so after using ctrl+c , it’s working everytime… At first, I only wanted to upload a file to ipfs using javascript but i’m still unable to do that, i’m working on it.
refrence https://github.com/ipfs/js-ipfs/blob/master/docs/core-api/FILES.md#options-11