Your cache folder contains root-owned files

If you encounter the following message in your build log:

npm ERR! code EACCES
npm ERR! syscall link
npm ERR! path /data/data/com.termux/files/home/.npm/_cacache/tmp/ca13ccc3
npm ERR! dest /data/data/com.termux/files/home/.npm/_cacache/content-v2/sha512/43/a6/c7e13485e371db122c19f97a126c3d3a05e3f3050a79998bac598ab110422ff6ca2d65f0907caa47c66eb551785374e9216de04eae820a0f45c2c0cdd376
npm ERR! errno EACCES
npm ERR!
npm ERR! Your cache folder contains root-owned files, due to a bug in
npm ERR! previous versions of npm which has since been addressed.
npm ERR!
npm ERR! To permanently fix this problem, please run:
npm ERR!   sudo chown -R 10272:10272 "/data/data/com.termux/files/home/.npm"

It means that some cache files in the repository contains wrong permissions and because of that the build pipeline is failing. In order to solve it, something like this should be added before executing the build command: export npm_config_cache=/.

Which changes the cache directory, et voilá, problem solved.

Still need help? Contact Us Contact Us