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.
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.
In addition, if you're the only user on that machine and you're sure that you don't have an open editor on that file in another window, you can just accept nano's offer to continue, it will remove the leftover swap file, saving you a few steps.
I was editing a file called serial.c and ran into that problem. I backed the file up using cp serial.c serial2.c and then deleted the original with rm serial.c. Issuing a nano serial.c still returned the error, even though the file didn't exist. Performing an ls -lA revealed that there was a hidden swapfile called .serial.c.swp, which I deleted using rm .serial.c.swp. Then I was able to rename my serial2.c back to serial.c using mv serial2.c serial.c, and now I'm able to edit the file without the conflict.
htopwhether this other
nanoinstance is still running. If it's not, there's most likely a hidden dotfile in the same folder which leads
nanoto believe that the other instance is still running (at least
vimworks this way, I don't use
ls -lAand look for a file that begins with
.server.jsor something like that.