gpt4 book ai didi

react-native - 如何将 React_Editor 设置为 PhpStorm,以便当您单击错误时它会跳转到代码?

转载 作者:行者123 更新时间:2023-12-05 06:07:03 24 4
gpt4 key购买 nike

我在 Mac 中使用 PhpStorm 进行编码,我想调试我的错误。我的终端中有一条消息,要求我为 React Native 工具设置编辑器。

    PRO TIP 
When you see Red Box with stack trace, you can click any
stack frame to jump to the source file. The packager will launch your
editor of choice. It will first look at REACT_EDITOR environment
variable, then at EDITOR.
To set it up, you can add something like
export REACT_EDITOR=atom to your ~/.bashrc or ~/.zshrc depending on
which shell you use.

我已经将这些行添加到 ~/.bashrc 但是当我点击错误时没有任何反应:

export PATH=$PATH:/usr/local/bin/pstorm
export REACT_EDITOR=pstorm

如何将 REACT_EDITOR 正确设置为 PhpStorm 以便当我点击错误时它会跳转到我的代码?

最佳答案

对于mac os你需要添加到~/.bashrc或者.zprofile:

添加 export REACT_EDITOR="webstorm"pstorm

在尝试之前不要忘记关闭所有终端窗口并重新启动 react-native packager。

创建打开 WebStorm 的快捷方式:

  1. 打开 WebStorm
  2. 按两次打开搜索窗口
  3. 键入“Create Command Line Launcher...”并按 Enter 键
  4. 点击确定 enter image description here

就是这样。

/usr/local/bin 默认情况下应该在 PATH 环境变量中。您应该能够从 shell 中的任何位置运行 webstorm。运行 webstorm/usr/local/bin/webstorm 来测试命令。

您可以找到打开编辑器的代码 here或者在你的项目 node_modules/@react-native-community/cli-tools/build/launchEditor.js

关于react-native - 如何将 React_Editor 设置为 PhpStorm,以便当您单击错误时它会跳转到代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65599117/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com