[nodemon] Error: watch /xxx/ ENOSPC 解决方法

本文介绍了解决在Ubuntu 18.04环境下使用nodemon时遇到的文件监控数量超出设定值的问题。通过调整系统参数fs.inotify.max_user_watches的值,可以有效提升nodemon对文件变化的监控能力。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 软件环境 ubuntu18.04, "nodemon": "^1.17.5"

 解决方法

命令行输入 
echo fs.inotify.max_user_watches=666666 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

解释一下这行命令的意思
echo fs.inotify.max_user_watches=666666的输出内容,
也就是"fs.inotify.max_user_watches=666666"通过|传给后面的命令,然后tee将前面的传过来的内容输出到标准输出的同时,追加到文件file中。如果文件不存在,则创建;如果已经存在,就在末尾追加内容,而不是覆盖,最后是系统重新加载配置文件,使更改生效.
大家可以到/proc/sys/fs/inotify下查看自己更改的值
错误原因
  就是一个程序监控的文件数量超出了设定值,这行命令就是把设定的值改大一些
进一步了解
inotify -- linux内核中的文件系统变化通知机制,我猜nodemon的watch就是通过他来实现的

error https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.18.20.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOSPC: no space left on device, write" error Error: ENOSPC: no space left on device, write info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command. error https://registry.npmmirror.com/@esbuild/android-x64/-/android-x64-0.21.4.tgz: ENOSPC: no space left on device, write error https://registry.npmmirror.com/@esbuild/aix-ppc64/-/aix-ppc64-0.21.4.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOSPC: no space left on device, write" error https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.21.4.tgz: ENOSPC: no space left on device, write error https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.21.4.tgz: ENOSPC: no space left on device, write error https://registry.npmmirror.com/@esbuild/android-arm/-/android-arm-0.21.4.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOSPC: no space left on device, write" error https://registry.npmmirror.com/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOSPC: no space left on device, write" error https://registry.npmmirror.com/@esbuild/linux-arm/-/linux-arm-0.21.4.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOSPC: no space left on device, write" error https://registry.npmmirror.com/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOSPC: no space left on device, write" error https://registry.npmmirror.com/@esbuild/linux-ia32/-/linux-ia32-0.21.4.tgz: ENOSPC: no space left on device, write error https://registry.npmmirror.com/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz: Extracting tar content of undefined failed, the file appears to be corrupt:
04-02
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值