![](/img/trans.png)
[英]How to solve "Unable to resolve module..." error with react-native?
[英]How to resolve the build error on react-native?
我正在尝试创建一个构建环境来制作 android 应用程序,但我未能成功构建该项目。 构建日志如下,
Starting Gradle Daemon...
Gradle Daemon started in 5 s 673 ms
:ReactNative:Running '[node, -e, console.log(require('react-native/cli').bin);]' command failed.
FAILURE: Build failed with an exception.
* Where:
Script 'C:\WorkSpace\MyProject\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' line: 179
* What went wrong:
A problem occurred evaluating script.
> Cannot run program "node" (in directory "C:\WorkSpace\MyProject\android"): CreateProcess error=2, �w�肳�ꂽ�t�@�C����������܂���B
它看起来与下面的链接完全相同,我做了同样的事情,但我无法解决问题,并且它生成的日志始终相同。
https://forums.expo.io/t/android-cannot-run-program-node-error-2-no-such-file-or-directory/37693
重新安装节点。 删除节点模块并清理并再次运行项目。
我无法发表评论,所以我回答了。
我更新了我正在使用的 nodejs 并解决了它。
之前:14.6.0
之后:14.7.0
我不知道确切的原因,并且 node_modules 似乎根本没有改变,但至少构建成功了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.