I work on several different nodejs projects at any given time and they all have different versions of NodeJS so instead of developing locally, I prefer to use docker.
My projects’ source code gets mounted into a docker image and then I use commands like the following to install dependencies:
docker-compose run worker npm install --save --save-exact MODULE_NAME
The benefit of this approach is that:
a) i’m not managing multiple nodejs versions on my local machine … they are inside the container image and don’t conflict with one another
b) i no longer forget to switch nodejs versions when switching in between projects on my terminal/CLI … each container has only one appropriate version of nodejs in it
c) i no longer install a dependency into my project using the wrong nodejs version … each container has only one appropriate version of nodejs in it
But recently running this:
docker-compose run worker npm install --save --save-exact MODULE_NAME
leads to the dependency being installed but the package.json
file not being updated because of:
WARN saveError EBUSY: resource busy or locked, rename '/apps/package.json.2435009273' -> '/apps/package.json'
I was wondering what could cause a file to be singled out in a mounted volume and be locked away from edits?