React-native 报错 java.io.IOExcept

2021-12-16  本文已影响0人  _一叶孤帆
:ReactNative:Running ‘[node, -e, console.log(require(‘react-native/cli’).bin);]’ command failed.

- Where:
Script ‘/Users/…/Desktop/…/node_modules/@react-native-community/cli-platform-android/native_modules.gradle’ line: 154

- What went wrong:
A problem occurred evaluating script.
> Cannot run program “node”: error=2, No such file or directory

Caused by: java.io.IOException: Cannot run program “node”: error=2, No such file or directory

原因是 Android 无法找到 node 命令
使用控制台启动 AS 即可。

参考链接
https://stackoverflow.com/questions/61922174/react-native-on-android-cannot-run-program-node-error-2-no-such-file-or-dir

上一篇下一篇

猜你喜欢

热点阅读