angular - 使用 tensorflowjs 项目运行 yarn watch 时出错

标签 angular ubuntu yarnpkg tensorflow.js

我正在使用带有 yarn 和节点 v 8.11.3 的 ubuntu 18
在此处运行示例时
使用以下 shell 命令

git clone https://github.com/tensorflow/tfjs-examples
cd tfjs-examples/webcam-transfer-learning
yarn
yarn watch

到达最后一行代码时出现以下错误:

yarn run v1.9.4 $ cross-env NODE_ENV=development parcel index.html --no-hmr --open Server running at http://localhost:1234 hourglass_flowing_sand Building asyncToGenerator.js... events.js:183 throw er; // Unhandled 'error' event ^

Error: watch /home/user/WebstormProjects/tfjs-examples/webcam-transfer-learning/node_modules/core-js/modules/es6.math.fround.js ENOSPC at _errnoException (util.js:992:11) at FSWatcher.start (fs.js:1382:19) at Object.fs.watch (fs.js:1408:11) at createFsWatchInstance (/home/user/WebstormProjects/tfjs-examples/webcam-transfer-learning/node_modules/chokidar/lib/nodefs-handler.js:37:15) at setFsWatchListener (/home/user/WebstormProjects/tfjs-examples/webcam-transfer-learning/node_modules/chokidar/lib/nodefs-handler.js:80:15) at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/user/WebstormProjects/tfjs-examples/webcam-transfer-learning/node_modules/chokidar/lib/nodefs-handler.js:232:14) at FSWatcher.NodeFsHandler._handleFile (/home/uwer/WebstormProjects/tfjs-examples/webcam-transfer-learning/node_modules/chokidar/lib/nodefs-handler.js:259:21) at FSWatcher. (/home/user/WebstormProjects/tfjs-examples/webcam-transfer-learning/node_modules/chokidar/lib/nodefs-handler.js:480:21) at FSReqWrap.oncomplete (fs.js:153:5) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.



我没有运气找到任何关于它的东西。
我尝试更改 tfjs 版本但没有成功
我升级了 Node,并尝试将其降级到早期的稳定版本。
我们尝试在 Windows 机器上运行它,并且成功了。

我们尝试使用在 Windows 机器上运行的相同版本:npm 8.10 和 yarn 5.04 没有运气

这里可能是什么问题?

谢谢

最佳答案

在终端使用以下两个命令解决了这个问题,我真的不知道为什么,谁能帮我解释一下?

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

然后
yarn 
yarn watch

效果很好

谢谢!

关于angular - 使用 tensorflowjs 项目运行 yarn watch 时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51836012/

相关文章:

Angular 4 : Close modal after form submit event is finished

node.js - "ng new xxx"给出错误错误代码-4048

javascript - 移动或重命名文件时更新导入/需要路径 - 不起作用

python - 在 Ubuntu 上用 python 导入一个 dll

angular - 如何使服务在库 Angular 中是全局的?

validation - angular2 - 在父 FormGroup 的子组件中验证 FormControlName

npm - yarn 错误日志文件的路径是什么?

node.js - 在新的 react 项目中使用 craco - 什么会导致这个错误? (未处理的PromiseRejectionWarning : TypeError [ERR_INVALID_ARG_VALUE]: . ..)

java - java 的 sleep() 和 c 的 sleep() 之间有什么区别?

javascript - 开 Jest - 没有输出测试结果