我最近一直在使用Tauri进行个人项目,我在两台不同的电脑上进行这个项目,因为我试图在业余时间从笔记本电脑上工作,如果我在外面,从我的桌面上工作。我从我的笔记本电脑上克隆了git repo,它工作得很好,但是如果我试图从我的桌面上再次运行它(在拉取项目更新后),就会发生这种情况:
如果我试图从我的笔记本电脑运行该项目,它仍然工作,没有改变代码或任何东西,我检查了端口没有被使用。
我用来运行项目的命令是网站上提供的命令:
npm run tauri dev
有人知道为什么会发生这种情况或如何解决这个问题吗?
1条答案
按热度按时间44u64gxh1#
我刚刚遇到了同样的问题。
事实证明,tauri.conf.json中的“devPath”与npm运行实际给我的不匹配。完整的输出消息如下所示:
在我的例子中,本地服务器是localhost,但tauri需要的是127.0.0.1
要解决这个问题,请编辑tauri.conf.json: