EBUSY on npm install because of rewrite of mounted package.json
See original GitHub issueHi! Thanks for your work of gathering all this stuff in one place!
But how do you managed to make npm install
work with direct package.json mounts? I get this errors every time:
resource busy or locked, rename '/opt/package.json.3249071875' -> '/opt/package.json'
because npm tries to rewrite file from scratch rather than make atomic writes.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:17 (5 by maintainers)
Top Results From Across the Web
npm install error code EBUSY errono -4082 - Stack Overflow
I found that is because I npm run in a terminal and npm install in another terminal. The file was occupied. I just...
Read more >package-lock.json - npm Docs
Describe a single representation of a dependency tree such that teammates, deployments, and continuous integration are guaranteed to install exactly the same ...
Read more >npm ERR! code EBUSY - Reddit
I'm running Windows 11 Pro. PS C:\_offline\BGIO Tutorial\testboard3\TestBoardGame> npm install npm WARN config global `--global`, `--local` are ...
Read more >The Complete Guide to package-lock.json - Medium
Here, foo is installed with version 2.3.0 [major minor patch] . The caret symbol tells something ... Why / When does npm install...
Read more >How To Use Node.js Modules with npm and package.json
By having Node.js installed you will also have npm installed; this tutorial uses version 8.11.0. Step 1 — Creating a package.json File.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This repo is just one example of using docker-compose. In my Docker for Node.js course, I cover two Solutions for designing the compose file for local development and students have thought of several other Solutions along the way.
I also talk about my two “Solutions” at DockerCon. Those slides start here in my talk.
This repo is more aligned with Solution 2 below, but you might consider Solution 1 if the package.json bind-mount issue is a blocker for you.
Solution 1:
docker-compose up
the first time, we’ll need to do adocker-compose run <app> npm install
to see the node_modules that are bind-mounted to the host. This is the main disadvantage of this Solution.Solution 2:
Isn’t there way using yarn’s
--modules-folder
? Assuming switch from NPM to yarn. https://stackoverflow.com/a/53998408/1763888 https://classic.yarnpkg.com/en/docs/cli/install#toc-yarn-install-modules-folderThen you shouldn’t need bind mounts on package*.json because all yarn commands should be feasible from project directory directly, shouldn’t?
Disclaimer: I haven’t tested it yet.