[英]Android Studio: Cannot run program "node"
I have project in React Native, and I'm not being able to build on the Android Studio due the following error.我在 React Native 中有项目,但由于以下错误,我无法在 Android Studio 上构建。
Here's the detailed log with additional info:这是带有附加信息的详细日志:
java.io.IOException: Cannot run program "node" (in directory "/Users/fabioernanni/git/fintech-ewallet-mobile/android"): error=2, No such file or directory
java.io.IOException: error=2, No such file or directory
Cause: error=2, No such file or directory
I have tried to reinstall Node, Android Studio, to link the tscript library so the Android Studio would recognize the "node" but nothing seems to help.我尝试重新安装 Node,Android Studio,以链接 tscript 库,以便 Android Studio 可以识别“节点”,但似乎无济于事。
I have a similar problem with Android Studio (bumble bee) version with node on My Mac M1 Chip so to solve this open your Android Studio from terminal .我的 Android Studio(大黄蜂)版本在我的 Mac M1 芯片上有节点,所以要解决这个问题,请从终端打开 Android Studio。 To Open Android Studio from terminal on Mac m1 just open your Terminal and paste the following command
要在 Mac m1 上从终端打开 Android Studio,只需打开终端并粘贴以下命令
open -a /Applications/Android\ Studio.app
this will open your android studio and then you can open your project and can run build from android studio Note : be sure that Android studio is not running state if its running just Quite it and then launch from Terminal这将打开您的 android 工作室,然后您可以打开您的项目并可以从 android 工作室运行构建注意:确保 Android 工作室没有运行 state 如果它正在运行,然后从终端启动
Do these steps to solve it:-执行以下步骤来解决它:-
STEP 1: First quit the android studio, if it is in a running state. STEP 1:先退出android studio,如果是在运行state。
command + Q
STEP 2: Enable the permission for android studio printenv.第 2 步:启用 android studio printenv 的权限。
sudo chmod +x /Applications/Android\ Studio.app/Contents/bin/printenv
STEP 3: Open android studio from terminal app.第 3 步:从终端应用程序打开 android 工作室。
open -a /Applications/Android\ Studio.app
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.