Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing plugins keeps failing because of es6-prepare-plugin

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?

like image 763
Siyah Avatar asked Jul 05 '17 15:07

Siyah


1 Answers

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 [email protected] and installing this plugin worked for me afterwards.

Ionic is so buggy sometimes. Very annoying.

like image 186
Siyah Avatar answered Nov 15 '22 03:11

Siyah