title: Getting Error EBUSY: resource busy or locked
body: <p>Trying to run a Nodejs app to test Raspberry 3 B + Gpio Onoff Module but when i am trying to run the app getting this Error</p>
  
  <pre><code>fs.js:114
  throw err;
  
  Error: EBUSY: resource busy or locked, write
  at Object.writeSync (fs.js:568:3)
  at Object.writeFileSync (fs.js:1199:26)
  at new Gpio (/home/pi/Desktop/pitesting/node_modules/onoff/onoff.js:96:10)
  at Object.&lt;anonymous&gt; (/home/pi/Desktop/pitesting/blink.js:3:7)
  at Module._compile (internal/modules/cjs/loader.js:701:30)
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
  at Module.load (internal/modules/cjs/loader.js:600:32)
  at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
  at Function.Module._load (internal/modules/cjs/loader.js:531:3)
  at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
  </code></pre>
  
  <p>Here is my App Code </p>
  
  <pre><code>var onoff = require('onoff');
  var Gpio = onoff.Gpio,
    led = new Gpio(4, 'out'),
    interval;
  interval = setInterval(function () {
    var value = (led.readSync() + 1) % 2;
    led.write(value, function () {
      console.log("Changed LED state to: " + value);
    });
  }, 2000);
  process.on('SIGINT', function () {
    clearInterval(interval);
    led.writeSync(0);
    led.unexport();
    console.log('Bye, bye!');
    process.exit();
  });
  </code></pre>
  
  <p>Already Tried Fixes by updating and upgrading apt and reinstalling node modules.</p>
  
  <p>Please Help me to resolve this issue.</p>