美文网首页React Native
解决RN打包:Process 'command 'node''

解决RN打包:Process 'command 'node''

作者: Beingsmile | 来源:发表于2020-02-25 12:44 被阅读0次

    在使用AndroidStudio打包RN项目时出现如下报错:

    一头雾水不知问题出在哪里.

    改用WebStorm运行试试,报错了,看到了错误信息,大致意思是nodu_modules里边有两个包里边都包含react-native库,导致重复Error: Duplicate

     hasteError: DuplicateHasteCandidatesError: The name `react-native` was looked up in the Haste module map. It cannot be resolved, because there exists several different files, or packages, that provide a module for that particular name and platform. The platform is generic (no extension). You must delete or blacklist files until there remains only one of these:

        * `/Users/wangshuyao/Work/RN_linjinsuo/node_modules/react-native-keyboard-aware-scroll-view/node_modules/react-native/package.json` (package)

        * `/Users/wangshuyao/Work/RN_linjinsuo/node_modules/react-native/package.json` (package)

    不仅仅是用WebStorm调试会报这个,直接用终端输入./gradlew assembleRelease也会输出这个错误!

    解决方案:直接删除提示重复的库里边的node_modules文件夹,问题得到解决!

    相关文章

      网友评论

        本文标题:解决RN打包:Process 'command 'node''

        本文链接:https://www.haomeiwen.com/subject/exnzqhtx.html