代码之家  ›  专栏  ›  技术社区  ›  Behnam Kamrani

Expo EAS本地构建:插件错误:无法解析相对于<您的构建目录>的模块<模块名称>的插件

  •  0
  • Behnam Kamrani  · 技术社区  · 2 年前

    我有一些插件在我的 app.config.js 文件,并得到以下错误,导致本地EAS构建失败。当我删除第一个插件时,下一个插件也会出现同样的错误,所以这个错误似乎与那个插件无关,而是与任何插件无关。使用世博skd 49;博览会版本6.3.10;eas-cli/4.1.0达尔文x64节点v19.6.1

    有什么想法吗?

    [READ_APP_CONFIG]
    PluginError: Failed to resolve plugin for module "expo-localization" relative to "easBuild/build"
        at resolvePluginForModule (/Users/behnam/.npm/_npx/7b94c2150570f17f/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js:72:11)
        at resolveConfigPluginFunctionWithInfo (/Users/behnam/.npm/_npx/7b94c2150570f17f/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js:152:7)
        at resolveConfigPluginFunction (/Users/behnam/.npm/_npx/7b94c2150570f17f/node_modules/@expo/config-plugins/build/utils/plugin-resolver.js:143:7)
        at withStaticPlugin (/Users/behnam/.npm/_npx/7b94c2150570f17f/node_modules/@expo/config-plugins/build/plugins/withStaticPlugin.js:87:70)
        at /Users/behnam/.npm/_npx/7b94c2150570f17f/node_modules/@expo/config-plugins/build/plugins/withPlugins.js:30:84
        at Array.reduce (<anonymous>)
        at withPlugins (/Users/behnam/.npm/_npx/7b94c2150570f17f/node_modules/@expo/config-plugins/build/plugins/withPlugins.js:30:18)
        at withConfigPlugins (/Users/behnam/.npm/_npx/7b94c2150570f17f/node_modules/@expo/config/build/plugins/withConfigPlugins.js:36:47)
        at fillAndReturnConfig (/Users/behnam/.npm/_npx/7b94c2150570f17f/node_modules/@expo/config/build/Config.js:217:78)
        at getConfig (/Users/behnam/.npm/_npx/7b94c2150570f17f/node_modules/@expo/config/build/Config.js:268:12)
    
    Build failed
    Skipping cleanup, ./easBuild won't be removed.
    Unknown error. See logs for more information.
    npx exited with non-zero code: 1
        Error: build command failed.
    

    插件在 app.config.js :

            plugins: [ 'expo-localization',
                [
                    'expo-updates',
                    {
                        username: 'onrun',
                    },
                ],
                [
                    'expo-camera', {
                        cameraPermission: 'To let you add photos to your profile or events.',
                    },
                ],
                [
                    'expo-build-properties',
                    {
                        ios: {
                            flipper: true,
                        },
                    },
                ],
            ],
    
    1 回复  |  直到 2 年前
        1
  •  1
  •   Hasan    1 年前

    安装 世博会建筑物业 软件包为我修复了这个bug。 运行:

    npx expo install expo-build-properties
    
        2
  •  -1
  •   Behnam Kamrani    1 年前

    指定生成目录似乎是错误的原因。当我通过取消设置env变量来删除本地构建目录时,构建就正常了。

    unset EAS_LOCAL_BUILD_WORKINGDIR

    评论[2024年7月15日]:我再次遇到这个问题 expo-location 关于Expo SDK 51和 eas-cli/10.0.0 darwin-x64 node-v20.12.2 这解决了这个问题。因此,如果您使用env变量指定了本地构建目录 EAS_LOCAL_BUILD_WORKINGDIR ,继续 unset 那。在这种情况下, 世博会地点 无法找到构建目录,错误如下。

    PluginError: Failed to resolve plugin for module "expo-location" relative to "easDist/build"
    
    推荐文章