Error: Cannot find module '../plugman/platforms/ios'

$ ionic cordova build ios
Running app-scripts build: --iscordovaserve --externalIpRequired --nobrowser

[21:34:13]  build dev started ...
[21:34:13]  clean started ...
[21:34:13]  clean finished in less than 1 ms
[21:34:13]  copy started ...
[21:34:13]  transpile started ...
[21:34:17]  transpile finished in 3.77 s
[21:34:17]  preprocess started ...
[21:34:17]  deeplinks started ...
[21:34:17]  deeplinks finished in 31 ms
[21:34:17]  preprocess finished in 31 ms
[21:34:17]  webpack started ...
[21:34:17]  copy finished in 4.04 s
[21:34:27]  webpack finished in 10.78 s
[21:34:27]  sass started ...
[21:34:29]  sass finished in 1.45 s
[21:34:29]  postprocess started ...
[21:34:29]  postprocess finished in 16 ms
[21:34:29]  lint started ...
[21:34:29]  build dev finished in 16.09 s
> cordova build ios
✖ Running command - failed!

[ERROR] Cordova encountered an error.
        You may get more insight by running the Cordova command above directly.

[ERROR] An error occurred while running cordova build ios (exit code 1):


        You have been opted out of telemetry. To change this, run: cordova telemetry on.
        CHCP plugin after prepare hook:
        Error: Cannot find module '../plugman/platforms/ios'

I’m using ionic v3
The error occurs when I’m try to add iOS platform to my project. Android platform build successfully.
Thank you!

What is this [quote=“osithIONIC, post:1, topic:91768”]
CHCP plugin
[/quote] that is causing the error?

Post your ionic info output please.
Post your package.json content and ionic cordovoa plugin list output please.

package,json

{
    "name": "ionic-hello-world",
    "version": "0.0.0",
    "author": "Ionic Framework",
    "homepage": "http://ionicframework.com/",
    "private": true,
    "scripts": {
        "clean": "ionic-app-scripts clean",
        "build": "ionic-app-scripts build",
        "lint": "ionic-app-scripts lint",
        "ionic:build": "ionic-app-scripts build",
        "ionic:serve": "ionic-app-scripts serve"
    },
    "dependencies": {
        "@angular/common": "4.1.0",
        "@angular/compiler": "4.1.0",
        "@angular/compiler-cli": "4.1.0",
        "@angular/core": "4.1.0",
        "@angular/forms": "4.1.0",
        "@angular/http": "4.1.0",
        "@angular/platform-browser": "4.1.0",
        "@angular/platform-browser-dynamic": "4.1.0",
        "@ionic-native/core": "3.7.0",
        "@ionic-native/in-app-browser": "^3.10.3",
        "@ionic-native/splash-screen": "3.7.0",
        "@ionic-native/status-bar": "3.7.0",
        "@ionic/storage": "^2.0.1",
        "angularfire2": "^4.0.0-rc.0",
        "cordova-android": "^6.2.3",
        "cordova-hot-code-push-plugin": "^1.5.2",
        "cordova-ios": "^4.4.0",
        "cordova-plugin-browsertab": "^0.2.0",
        "cordova-plugin-buildinfo": "^1.1.0",
        "cordova-plugin-compat": "^1.0.0",
        "cordova-plugin-console": "1.0.5",
        "cordova-plugin-customurlscheme": "^4.2.0",
        "cordova-plugin-device": "1.1.4",
        "cordova-plugin-inappbrowser": "^1.7.1",
        "cordova-plugin-splashscreen": "~4.0.1",
        "cordova-plugin-statusbar": "2.2.2",
        "cordova-plugin-whitelist": "1.3.1",
        "cordova-sqlite-storage": "^2.0.4",
        "cordova-universal-links-plugin": "^1.2.1",
        "firebase": "^3.9.0",
        "ionic-angular": "^3.3.0",
        "ionic-plugin-keyboard": "~2.2.1",
        "ionicons": "3.0.0",
        "rxjs": "5.1.1",
        "sw-toolbox": "3.6.0",
        "zone.js": "0.8.10"
    },
    "devDependencies": {
        "@ionic/app-scripts": "1.3.7",
        "@ionic/cli-plugin-cordova": "1.1.2",
        "@ionic/cli-plugin-ionic-angular": "1.1.2",
        "typescript": "2.2.1"
    },
    "cordovaPlugins": [
        "cordova-plugin-whitelist",
        "cordova-plugin-console",
        "cordova-plugin-statusbar",
        "cordova-plugin-device",
        "cordova-plugin-splashscreen",
        "ionic-plugin-keyboard"
    ],
    "cordovaPlatforms": [],
    "description": "music: An Ionic project",
    "cordova": {
        "plugins": {
            "cordova-plugin-console": {},
            "cordova-plugin-device": {},
            "cordova-plugin-splashscreen": {},
            "cordova-plugin-statusbar": {},
            "cordova-plugin-whitelist": {},
            "ionic-plugin-keyboard": {},
            "cordova-sqlite-storage": {},
            "cordova-plugin-inappbrowser": {},
            "cordova-plugin-buildinfo": {},
            "cordova-plugin-browsertab": {},
            "cordova-plugin-customurlscheme": {
                "URL_SCHEME": "com.firebase.cordova",
                "ANDROID_SCHEME": " ",
                "ANDROID_HOST": " ",
                "ANDROID_PATHPREFIX": "/"
            },
            "cordova-hot-code-push-plugin": {},
            "cordova-universal-links-plugin": {}
        },
        "platforms": [
            "android"
        ]
    }
}

ionic info

$ ionic info

global packages:

    @ionic/cli-utils : 1.2.0
 You have been opted out of telemetry. To change this, run: cordova telemetry on. 7.0.
    Ionic CLI        : 3.2.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.1.2
    @ionic/cli-plugin-ionic-angular : 1.1.2
    Ionic Framework                 : ionic-angular 3.3.0

System:

    Node       : v7.9.0
    OS         : Windows 10
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

ionic cordova plugin list

$ ionic cordova plugin list
> cordova plugin ls
✔ Running command - done!

You have been opted out of telemetry. To change this, run: cordova telemetry on.
cordova-hot-code-push-plugin 1.5.2 "Hot Code Push Plugin"
cordova-plugin-browsertab 0.2.0 "cordova-plugin-browsertab"
cordova-plugin-buildinfo 1.1.0 "BuildInfo"
cordova-plugin-compat 1.0.0 "Compat"
cordova-plugin-console 1.0.5 "Console"
cordova-plugin-customurlscheme 4.2.0 "Custom URL scheme"
cordova-plugin-device 1.1.4 "Device"
cordova-plugin-inappbrowser 1.7.1 "InAppBrowser"
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"
cordova-universal-links-plugin 1.2.1 "Universal Links Plugin"
ionic-plugin-keyboard 2.2.1 "Keyboard"

So I guess this “CHCP” that is producing the error is probably this:

There is a issue on its repo for exactly this error message:

There is also a solution, although npm and releases of the plugin seem to be a bit fucked up.

Just got a reply on that issue, update is now on NPM.

Thank you! I’ll try it

you’re using ionic 1 code with ionic 2 server, update your code it’s sllightly different.