ionic building TypeError: env.runcmd is not a func

2019-08-17 04:58发布

问题:

During build of an ionic App, this error is shown:

anyone can help me ?

回答1:

It says:

Error occurred during command execution from a CLI plugin (@ionic/cli-plugin-cordova). Your plugins may be out of date.

Did you try to install latest cordova plug-in :

$> npm install @ionic/cli-plugin-cordova@latest

Also update the dependencies....



回答2:

Things to try:

  1. run "cordova platform add ios" and "cordova platform add android"
  2. run npm install --save --save-exact ionic@3.6.0 and then upgrade it to newest version
  3. if it still does not work then just do downgrade without upgrade and wait until stable version will be released


回答3:

In my case, I just change version package.json of this two plugins under devDependencies section. (In your case version number may differ)

 "@ionic/cli-plugin-cordova" : "1.4.1",
 "@ionic/cli-plugin-ionic-angular" : "1.3.2"

after this change in package.json run below command:

npm update

Now try to build, it's working.



回答4:

I my case what I did was went to the project folder and ran the following command to Get it working

cd platforms/ios/cordova && npm install ios-sim@latest


回答5:

The main problem for me was the @ionic/cli-plugin-cordova , so I downgraded it to v1.4.1 ( Don't know if any of the later versions are working fine.)

Command: npm install --save-dev @ionic/cli-plugin-cordova@1.4.1