I’m trying to set up freeCodeCamp locally on my Windows machine. But I’m running into an error during one of the installation steps.
npm ERR! path /app/curriculum/node_modules
npm ERR! code EBUSY
npm ERR! errno -16
npm ERR! syscall rmdir
npm ERR! EBUSY: resource busy or locked, rmdir '/app/curriculum/node_modules
The node_modules
directory under /app/curriculum/
cannot be deleted. And it’s something to do with my setup, because the same command seems to work with another user.
The error happens when I run npm run docker:install
, which is defined in their package.json
file as "docker-compose run -u root --rm freecodecamp bash patch_npm_and_install.sh"
.
I tried to get in the container manually and delete the node_modules
folder, but even that didn’t work -
PS C:\Users\Manish\Documents\Development\Github\FCC\FreeCodeCamp> docker-compose run -u root --rm freecodecamp bash
Starting freecodecamp_db_1 ... done
Starting freecodecamp_mailhog_1 ... done
root@827ef3175784:/app# ls
CODE_OF_CONDUCT.md README.md client docker-compose.tests.yml libcimp_index_js.patch package.json tools
CONTRIBUTING.md SECURITY.md config docker-compose.yml mock-guide patch_npm_and_install.sh utils
Dockerfile.tests api-server curriculum docs node_modules sample.env
LICENSE.md change_volumes_owner.sh docker-compose-shared.yml lerna.json package-lock.json search-indexing
root@827ef3175784:/app# cat patch_npm_and_install.sh
#!/usr/bin/env bash
patch /usr/local/lib/node_modules/npm/node_modules/libcipm/index.js < libcimp_index_js.patch
su node -c "npm ci"
root@827ef3175784:/app# cd curriculum/
root@827ef3175784:/app/curriculum# ls
CHANGELOG.md build commitizen.config.js create-challenge-bundle.js gulpfile.js lib.js node_modules package-lock.json schema utils.js
LICENSE.md challenges commitlint.config.js getChallenges.js index.js md-translation.js package-entry.js package.json test
root@827ef3175784:/app/curriculum# rmdir node_modules/
rmdir: failed to remove 'node_modules/': Device or resource busy
I tried to use lsof
to see if some process is using files in node_modules
, but nothing came up -
root@827ef3175784:/app/curriculum# lsof +D /app/curriculum/node_modules
root@827ef3175784:/app/curriculum#
How can I fix this issue?