操作系统:Ubuntu18.04
我创建了一个简单的create-react-app项目,然后使用yarn start启动了一个服务器。30%的时间,它的工作很好,但70%的时候,我得到以下错误。
Starting the development server...
events.js:167
throw er; // Unhandled 'error' event
^
Error: ENOSPC: no space left on device, watch '/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/public'
at FSWatcher.start (internal/fs/watchers.js:164:26)
at Object.watch (fs.js:1232:11)
at createFsWatchInstance (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:37:15)
at setFsWatchListener (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:80:15)
at FSWatcher.NodeFsHandler._watchWithNodeFs (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:232:14)
at FSWatcher.NodeFsHandler._handleDir (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:414:19)
at FSWatcher.<anonymous> (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:462:19)
at FSWatcher.<anonymous> (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:467:16)
at FSReqWrap.oncomplete (fs.js:155:5)
Emitted 'error' event at:
at FSWatcher._handleError (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/index.js:260:10)
at createFsWatchInstance (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:39:5)
at setFsWatchListener (/media/prameshbajra/pramesh/Code/learning-react-redux/shopping-cart/node_modules/chokidar/lib/nodefs-handler.js:80:15)
[... lines matching original stack trace ...]
at FSReqWrap.oncomplete (fs.js:155:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.我不知道这个错误是怎么发生的。我的笔记本电脑上几乎没有任何东西,大约90%的硬盘是免费的。工作目录有几乎200+ GB的空闲空间。我还尝试通过将整个项目复制到不同的位置(也是不同的驱动器)来启动该项目,但没有一个成功。同时,尝试了npm start,但这也不起作用。
发布于 2018-09-21 02:18:37
尝试删除您的node_modules文件夹,然后使用NPM安装('npm i')和运行('npm运行开始‘),而不是纱。我也收到了同样的错误,阻止我使用Yarn运行Node项目。我尝试了Node v10.0和8.12.0。删除我的node_modules文件夹并重新安装亚恩没有帮助。
发布于 2018-09-16 13:57:35
您需要检查您的Node.js版本。
正如文档所说,You’ll need to have Node >= 6 on your local development machine
发布于 2019-05-15 05:27:55
我也有过类似的问题。通过增加智能手表的数量来解决这个问题。在这里使用帮助:https://github.com/parcel-bundler/parcel/issues/1427 https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers
通过使用:sudo sysctl fs.inotify.max_user_watches=999999999和持久化使用:
echo fs.inotify.max_user_watches=999999999 | sudo tee -a /etc/sysctl.conf
sudo sysctl --systemhttps://stackoverflow.com/questions/52346505
复制相似问题