Installing plugins keeps failing because of es6-prepare-plugin - ios

I am trying to prepare my iOS app and I need to get socialsharing and the whitelist plugin working, but they do not work. For example, when I do this:
sudo cordova plugin add cordova-plugin-x-socialsharing
I get this:
Installing "cordova-plugin-x-socialsharing" for android
Failed to install 'cordova-plugin-x-socialsharing':
CordovaError:
Failed to fetch plugin es6-promise-plugin via registry. Probably this
is either a connection problem, or plugin spec is incorrect. Check
your connection and plugin name/version/URL. Error: npm: Command
failed with exit code 1 Error output: npm ERR! code ENOLOCAL npm ERR!
Could not install from "node_modules/es6-promise-plugin" as it does
not contain a package.json file.
npm ERR!
How can I fix this? I tried everything. From sudo to non-sudo commands, but nothing is working for me. Adding es6-prepare-plugin manually does not work either.
My system information:
Cordova CLI: 7.0.1
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Framework Version: 1.3.3
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
ios-deploy version: 1.9.0
ios-sim version: 5.0.8
OS: Mac OS X El Capitan
Node Version: v6.8.1
Xcode version: Xcode 8.3.3 Build version 8E3004b
PS: in my package.json file, I see this:
"es6-promise-plugin": "file:node_modules/es6-promise-plugin",
How can I change this?

Oh dear Lord. I found the answer I was looking for, after I've struggled for hours. This link on Github is the answer to this problem.
Seems like npm version 5.x.x does not work with some ionic-plugins. I downgraded to npm 4 using npm install -g npm#4.6.1 and installing this plugin worked for me afterwards.
Ionic is so buggy sometimes. Very annoying.

Related

Minimum version required of Amplify CLI is not installed in Xcode

warning: AmplifyTools has been deprecated.
More info: https://github.com/aws-amplify/amplify-ios/blob/main/AmplifyTools/README.md
error: Minimum version required of Amplify CLI is not installed.
Min required version: (4.22.0)
Found Version: ([0m5.1.0[0m)
To install the latest version, please run the following command:
npm install -g #aws-amplify/cli#latest
As we can see found version is latest, but it is not taking.
when I checked in terminal amplify version:

Cordova 8 + iOS 4.5.4 = cannot find module "../cordova/platform_metadata"

Since the latest update to v8 of Cordova, I cannot build anything on Mac.
I always get
(node 626) UnhandledPromiseRejectionWarning: Error: Cannot find module '../cordova/platform_metadata'
I tried what was suggested in this post but I get the same error.
I then did a verbose and it seems like the plugin required to build for ios is not working well
Executing script found in plugin cordova-plugin-swift-support for hook "after_prepare": plugins/cordova-plugin-swift-support/src/add-swift-support.js
Resolving module name for cordova-lib/src/cordova/platform_metadata => ../cordova/platform_metadata
(node:599) UnhandledPromiseRejectionWarning: Unhandled promise rejection
(rejection id: 1): Error: Cannot find module '../cordova/platform_metadata'
(node:599) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.
This was a bug in cordova-plugin-add-swift-support, just update it to latest version (1.7.1)
cordova plugin rm cordova-plugin-add-swift-support
cordova plugin add cordova-plugin-add-swift-support
you need to downgrade cordova 7.1.0 until this issue is fixed. Do this:
npm uninstall -g cordova
npm install -g cordova#7.1.0
cordova platform remove ios
cordova platform add ios
If your running an ionic project that requires the swift plugin you'll need to add the --force flag:
ionic cordova plugin rm cordova-plugin-add-swift-support --force
Then run:
ionic cordova plugin add cordova-plugin-add-swift-support
That just happened to me (using Ionic). In Ionic, the issue comes from a plugin or node_module that is still using cordova/platform_metadata, which is deprecated.
If you are using Linux, in your project directory, try this in the command shell:
grep -iRn 'platform_metadata'
In my case, it was the plugin cordova-plugin-add-swift-support that was still using that, and I wasn't even using that plugin my project, so I deleted it manually. Problem solved. The issue seems to arise when a plugin is calling a module that no longer exists, so you have to either remove that plugin or update it.
With Ionic 3 and Cordova 8.0.0 project.
Here are steps
ionic cordova platform remove ios
ionic cordova plugin rm cordova-plugin-add-swift-support
ionic cordova plugin add cordova-plugin-add-swift-support
ionic cordova platform add ios
I have faced same problem, then upgraded Cordova to 7.1.0 work for me
From my ionic project I did (bash):
grep -r 'platform_metadata' .
and found I had a plugin called cordova-plugin-swift-support was the culprit. I removed it and then added cordova-plugin-add-swift-support back in, and everything worked fine with cordova 8.0.0

Cordova Reading build config file error: Cannot read property 'name' of undefined

I'm using Cordova (7.0.1) and after I'm executing
cordova run ios "--target=iPhone-7, 10.3"
I'm getting error
MAC:folder user$ cordova run ios "--target=iPhone-7, 10.3"
Reading build config file: Error: Cannot read property 'name' of undefined
However, after I'm executing
cordova run ios "--target=iPhone-7, 10.3"
Everything works just fine. 'Verbose' doesn't help really.
I thought that the issue is connected with this issue, so I tried to do
cd platforms/ios/cordova/node_modules/
sudo npm install -g ios-sim#latest
But no luck.
Any ideas why it doesn't work if I specify iOS version and how to fix it?
Do I need to put a 'name' property somewhere or it's just a bug?
Node : 8.1.4
npm : 5.4.1
ios-deploy : 1.9.2
ios-sim : 6.0.0
OS : 10.12.6
Xcode : 8.3.3 (8E3004b)
Looks like this is my issue: issues.apache.org: cordova emulate ios with --target throws undefined error
Guys from Apache are saying that it was fixed in cordova-ios#4.5.0
So this solved my issue
npm i -g cordova-ios#latest
However is going to do that - please make sure do it not only for global, but for local project too. i.e.
npm i cordova-ios#latest
I hope it helps. 🙂

IONIC:Unable to install phonegap-plugin-push in ios app

I am new with ionic framework.Currently i am working on ionic iOS app. when i install phonegap-plugin-push i am getting error
Failed to install 'phonegap-plugin-push':undefined Error: /Library/Ruby/Gems/2.0.0/gems/claide-1.0.1/lib/claide/command.rb:439:in `help!': [!] You cannot run CocoaPods as root. (CLAide::Help)
i have searched it but no solution found yet!
I also got same kind of problem. In my case I used sudo ionic platform add ios
This is worked well while building every plugins but phonegap-plugin-push.
phonegap-plugin-push is keep giving above error [!] You cannot run CocoaPods as root. (CLAide::Help)
Then I used ionic platform add ios without sudo This is the actual solution for this. But in this case It is keep giving me the permission related issue code EACCESS.
Then I used followings step to overcome that one.
sudo chown -R $USER /usr/local/
Again added cordoava and ionic
sudo npm install -g cordova
sudo npm install -g ionic
Other informations
phonegap-plugin-push version: 1.10.0
Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.2
Node Version: v7.7.2
Xocde Version: Xcode 8.2.1
CocoaPods Version: 1.2.0
Hope this will help.

Error while installing Ionic with node v5.0.0 and npm v3.3.6

I have installed nodejs version 5.0.0 and npm 3.3.6 on my MacBook pro. Every time i try to install ionic i get the following error:
npm ERR! Darwin 15.0.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "ionic"
npm ERR! node v5.0.0
npm ERR! npm v3.3.6
npm ERR! code ECONNRESET
npm ERR! errno ECONNRESET
npm ERR! syscall read
How can i fix this ?
After reading the Cordova API CLI requirements on OSX. i found out that i need the have all iOS SDK tools which is part of XCode installation.
Cordova CLI requirements for OSX:
http://cordova.apache.org/docs/en/5.1.1/guide/platforms/ios/index.html
So this is the steps to get Ionic up and running on OSX ElCapitan 10.11.1 and to fix the issue i had earlier:
1) Download and then Install XCode on your OSX.
2) Run the following command in your terminal:
sudo npm install -g cordova ionic
3) You will be able to install both Cordova and Ionic on your machine with no errors as it was showing earlier.
4) Try to create a project to validate everything is good to go in the terminal window:
ionic start mostafaApp1 tabs
You will find that the project has been created successfully.
Hope this helps.
I use to have the exact same error.
In the Installation Guide from ionic (http://ionicframework.com/docs/v2/getting-started/installation/) explains that you need a Node.js version 6 or greater to install ionic.
I fixed it by upgrading my Node.js to the current version "v6.8.0", and then my installation from ionic work without errors! :)
You can download the latest version from Node.js from the official website: "https://nodejs.org/en/"

Resources