ENOSPC no space left on device -Nodejs

Solution 1:

Just need to clean up the Docker system in order to tackle it. Worked for me.

$ docker system prune

Link to official docs

Solution 2:

I had the same problem, take a look at the selected answer in the Stackoverflow here:

Node.JS Error: ENOSPC

Here is the command that I used (my OS: LinuxMint 18.3 Sylvia which is a Ubuntu/Debian based Linux system).

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

Solution 3:

In my case, I got the error 'npm WARN tar ENOSPC: no space left on device' while running the nodeJS in docker, I just used below command to reclaim space.

sudo docker system prune -af

Solution 4:

I have come across a similar situation where the disk is free but the system is not able to create new files. I am using forever for running my node app. Forever need to open a file to keep track of node process it's running.

If you’ve got free available storage space on your system but keep getting error messages such as “No space left on device”; you’re likely facing issues with not having sufficient space left in your inode table.

use df -i which gives IUser% like this

Filesystem       Inodes  IUsed    IFree IUse% Mounted on
udev             992637    537   992100    1% /dev
tmpfs            998601   1023   997578    1% /run

If your IUser% reaches 100% means your "inode table" is exhausted

Identify dummy files or unnecessary files in the system and deleted them