Ubuntu – File server.js is being edited (by root with nano 2.4.2, PID xxxx); continue

nanoUbuntu

I am on Ubuntu 15.10 x64. When I am trying to edit server.js file, it is opening a blank nano editor and displaying
"File server.js is being edited (by root with nano 2.4.2, PID xxxx); continue?"
with options – Yes, No, Cancel.

I copied a backup file on this file but still I am getting the same message.

Could you please suggest how to resolve this.

Best Answer

Check with tools like ps and htop whether this other nano instance is still running. If it's not, there's most likely a hidden dotfile in the same folder which leads nano to believe that the other instance is still running (at least vim works this way, I don't use nano; try ls -lA and look for a file that begins with .server.js or something like that.

Related Question