美文网首页
ReactNative端口被占用后无法启动程序

ReactNative端口被占用后无法启动程序

作者: 太二道士 | 来源:发表于2017-05-09 19:24 被阅读307次

在开发RN的程序时候,有时候会出现一种莫名其妙的Bug,程序报错提示

This might be related to https://github.com/facebook/react-native/issues/4968
To resolve try the following:
  1. Clear watchman watches: `watchman watch-del-all`.
  2. Delete the `node_modules` folder: `rm -rf node_modules && npm install`.
  3. Reset packager cache: `rm -fr $TMPDIR/react-*` or `npm start -- --reset-cache`.

根据提示处理后仍不能解决,后来偶尔发现默认的8081端口被占用,程序无法启动


端口被占用.jpeg

调用命令发现 被64482进程占用了

lsof -i :8081

kill掉进程

kill -9 64482 

然后执行react-native run-ios 可以继续愉快的玩耍了

相关文章

网友评论

      本文标题:ReactNative端口被占用后无法启动程序

      本文链接:https://www.haomeiwen.com/subject/flyitxtx.html