Error: watch ENOSPC 的解决方案

本文介绍了在Fedora和Ubuntu系统中使用gulp时遇到的Error:watch ENOSPC问题及其解决办法。该错误源于系统对文件句柄数量的限制,通过调整fs.inotify.max_user_watches参数可有效解决。

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

在Fedora和Ubuntu的操作系统中,使用gulp时出现问题,gulp报错Error:watch ENOSPC的问题

出现类似这种错误可以试试


Error: watch ENOSPC

    at errnoException (fs.js:1024:11)
    at FSWatcher.start (fs.js:1056:11)
    at Object.fs.watch (fs.js:1081:11)
    at startWatcher (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:359:27)
    at watchDir (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:392:14)
    at compilePath (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:139:9)
    at Object.exports.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:98:20)
    at Object.<anonymous> (/usr/local/lib/node_modules/coffee-script/bin/coffee:7:41)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)

    at node.js:902:3

当前问题主要是因为gulp的watch需要监听很多文件的改动,但是fedora、ubuntu系统的文件句柄其实是有限制的,因此可以使用以下命令:

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

  对于以上Linux下gulp报错Error:watch ENOSPC的解决方法就介绍完了


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
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值