Ionic Cloud build error - Cannot find module 'lodash'

Hi,
I’m trying to build an app for iOS platform using Ionic cloud service, but it always fails with the error message:

Error: Error loading dependencies - ensure the plugin has been installed via cordova-fetch or run ‘npm install cordova-custom-config’: Cannot find module ‘lodash’

I run the command “npm install cordova-custom-config” and the package was installed successfully, but building app still failed with the same error message.

Do I need to change something in my config.xml file in order to fix this?

Here is ionic info output:

cli packages: (C:\ionicproject)

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

global packages:

Cordova CLI : 7.0.1

local packages:

@ionic/app-scripts : 1.3.7
Cordova Platforms  : android 6.2.3 ios 4.4.0
Ionic Framework    : ionic-angular 3.4.2

System:

Node : v6.7.0
npm  : 3.10.3
OS   : Windows 10

This is super old. Update it (and note the breaking changes for 2.x)

1 Like

Thank you for pointing that out. However, after updating it, I’m still getting the same error message https://prnt.sc/ghpcn5

Create a new project with ionic start blank blank, upload and build that one. Does this work for you?

1 Like

Here is my current ionic info output:

cli packages: (C:\ionicproject)

@ionic/cli-utils  : 1.9.2
ionic (Ionic CLI) : 3.9.2

global packages:

Cordova CLI : 7.0.1

local packages:

@ionic/app-scripts : 2.1.4
Cordova Platforms  : android 6.2.3 ios 4.4.0
Ionic Framework    : ionic-angular 3.4.2

System:

Node : v6.7.0
npm  : 3.10.3
OS   : Windows 10

Yes, that worked.
Does this mean that there is something wrong with my config.xml file?

It just means that something is going wrong with your project for now.
Compare package.json and config.xml and see if something jumps out at you.

What plugins do you have installed? ionic cordova plugin list to output.

1 Like

Here is the plugins list:

cordova-custom-config 4.0.2 "cordova-custom-config"
cordova-plugin-camera 2.4.1 "Camera"
cordova-plugin-compat 1.1.0 "Compat"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-crosswalk-webview 2.3.0 "Crosswalk WebView Engine"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-file 4.3.3 "File"
cordova-plugin-file-transfer 1.6.3 "File Transfer"
cordova-plugin-filepath 1.0.2 "FilePath"
cordova-plugin-secure-storage 2.6.8 "SecureStorage"
cordova-plugin-splashscreen 4.0.3 "Splashscreen"
cordova-plugin-statusbar 2.2.2 "StatusBar"
cordova-plugin-whitelist 1.3.1 "Whitelist"
cordova-sqlite-storage 2.0.4 "Cordova sqlite storage plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"
phonegap-plugin-push 2.0.0 “PushPlugin”

You mean plugins sections? If so, then nothing seems to be wrong with those:

package.json:

"cordova": {
    "plugins": {
        "cordova-plugin-console": {},
        "cordova-plugin-device": {},
        "cordova-plugin-splashscreen": {},
        "cordova-plugin-statusbar": {},
        "cordova-plugin-whitelist": {},
        "ionic-plugin-keyboard": {},
        "cordova-plugin-secure-storage": {},
        "cordova-sqlite-storage": {},
        "cordova-plugin-crosswalk-webview": {
            "XWALK_VERSION": "23+",
            "XWALK_LITEVERSION": "xwalk_core_library_canary:17+",
            "XWALK_COMMANDLINE": "--disable-pull-to-refresh-effect",
            "XWALK_MODE": "embedded",
            "XWALK_MULTIPLEAPK": "true"
        },
        "cordova-plugin-camera": {
            "CAMERA_USAGE_DESCRIPTION": " ",
            "PHOTOLIBRARY_USAGE_DESCRIPTION": " "
        },
        "cordova-plugin-file": {},
        "cordova-plugin-file-transfer": {},
        "cordova-plugin-filepath": {},
        "cordova-custom-config": {},
        "cordova-plugin-compat": {},
        "phonegap-plugin-push": {}
    },
    "platforms": [
        "android",
        "ios"
    ]
}

config.xml

<plugin name="cordova-custom-config" spec="^4.0.2" />
<plugin name="cordova-plugin-camera" spec="^2.4.1">
    <variable name="CAMERA_USAGE_DESCRIPTION" value=" " />
    <variable name="PHOTOLIBRARY_USAGE_DESCRIPTION" value=" " />
</plugin>
<plugin name="cordova-plugin-console" spec="^1.0.5" />
<plugin name="cordova-plugin-crosswalk-webview" spec="^2.3.0">
    <variable name="XWALK_VERSION" value="23+" />
    <variable name="XWALK_LITEVERSION" value="xwalk_core_library_canary:17+" />
    <variable name="XWALK_COMMANDLINE" value="--disable-pull-to-refresh-effect" />
    <variable name="XWALK_MODE" value="embedded" />
    <variable name="XWALK_MULTIPLEAPK" value="true" />
</plugin>
<plugin name="cordova-plugin-device" spec="^1.1.4" />
<plugin name="cordova-plugin-file" spec="^4.3.3" />
<plugin name="cordova-plugin-file-transfer" spec="^1.6.3" />
<plugin name="cordova-plugin-filepath" spec="^1.0.2" />
<plugin name="cordova-plugin-secure-storage" spec="^2.6.8" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.3" />
<plugin name="cordova-plugin-statusbar" spec="^2.2.2" />
<plugin name="cordova-plugin-whitelist" spec="^1.3.1" />
<plugin name="cordova-sqlite-storage" spec="^2.0.4" />
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
<plugin name="cordova-plugin-compat" spec="^1.1.0" />
<plugin name="phonegap-plugin-push" spec="^2.0.0" />

What are you using these for?

Can you also please post the complete output of the build process, not just the error message?


Offtopic:

I think these should have a value, otherwise Apple will decline oyur app.

1 Like

Thank you Sujan12 for helping me solve this problem! :slight_smile:
I’m getting successful builds now.

I removed cordova-custom-config plugin using ionic cordova plugin remove cordova-custom-config command and that fixed the issue.

1 Like

Ha, great it works now. This plugin is always trouble, although it solves some important problems. (Future Cordova version won’t need it at all though - Yay!)

1 Like