Can't install YouTubeVideoPlayer

Hello, using last version of ionic, I am trying to install YouTubeVideoPlayer running plugin “ionic cordova plugin add https://github.com/JonSmart/CordovaYoutubeVideoPlayer” as ionics doc says but I get this error “Running command - failed!”

Console:


$ ionic cordova plugin add https://github.com/JonSmart/CordovaYoutubeVideoPlayer
> cordova plugin add https://github.com/JonSmart/CordovaYoutubeVideoPlayer --save
✖ 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 plugin add https://github.com/JonSmart/CordovaYoutubeVideoPlayer --save (exit code 1):
        
        Error: Failed to fetch plugin https://github.com/JonSmart/CordovaYoutubeVideoPlayer 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 235 Error output:
        npm ERR! addLocal Could not install /tmp/npm-12533-beacc466/git-cache-03dadb8c/2a0cc8f3790b584ed1aae3927d03f7213e90c9d0
        npm ERR! code EISDIR
        npm ERR! errno -21
        npm ERR! syscall read
        npm ERR! eisdir EISDIR: illegal operation on a directory, read
        npm ERR! eisdir This is most likely not a problem with npm itself
        npm ERR! eisdir and is related to npm not being able to find a package.json in
        npm ERR! eisdir a package you are trying to install.
        
        npm ERR! A complete log of this run can be found in:
        npm ERR!     /home/gsantamaria/.npm/_logs/2017-05-26T17_09_24_534Z-debug.log

Then try:

$ cordova plugin add https://github.com/JonSmart/CordovaYoutubeVideoPlayer --save
Error: Failed to fetch plugin https://github.com/JonSmart/CordovaYoutubeVideoPlayer 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 235 Error output:
npm ERR! addLocal Could not install /tmp/npm-12678-c81bd94b/git-cache-691df5e6/2a0cc8f3790b584ed1aae3927d03f7213e90c9d0
npm ERR! code EISDIR
npm ERR! errno -21
npm ERR! syscall read
npm ERR! eisdir EISDIR: illegal operation on a directory, read
npm ERR! eisdir This is most likely not a problem with npm itself
npm ERR! eisdir and is related to npm not being able to find a package.json in
npm ERR! eisdir a package you are trying to install.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/gsantamaria/.npm/_logs/2017-05-26T17_11_43_094Z-debug.log

Anyone know why I getting this error?
Thanks.

Something is broken/strange with your npm.

  1. Restart your system, maybe this already fixes it
  2. Tell us a bit about your node, npm, ionic info

Thanks for answer, restart doesn’t fix it

npm:

{ 'ionic-hello-world': '0.0.0',
  npm: '4.6.1',
  ares: '1.10.1-DEV',
  http_parser: '2.7.0',
  icu: '56.1',
  modules: '48',
  node: '6.10.3',
  openssl: '1.0.2k',
  uv: '1.9.1',
  v8: '5.1.281.101',
  zlib: '1.2.11' }

ionic info:

global packages:

    @ionic/cli-utils : 1.1.2
    Cordova CLI      : 7.0.1 
    Ionic CLI        : 3.1.2

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.2.1
    @ionic/cli-plugin-ionic-angular : 1.2.0
    Cordova Platforms               : android 6.2.3
    Ionic Framework                 : ionic-angular 3.2.1

System:

    Node       : v6.10.3
    OS         : Linux 4.4
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed

I got the below error too:

sudo cordova plugin add https://github.com/JonSmart/CordovaYoutubeVideoPlayer
Password:
Error: Failed to fetch plugin https://github.com/JonSmart/CordovaYoutubeVideoPlayer 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 235 Error output:
npm ERR! addLocal Could not install /tmp/npm-1272-8cfb9687/git-cache-022c5761/2a0cc8f3790b584ed1aae3927d03f7213e90c9d0
npm ERR! Darwin 16.6.0
npm ERR! argv “/usr/local/Cellar/node/7.10.0/bin/node” “/usr/local/bin/npm” “install” “https://github.com/JonSmart/CordovaYoutubeVideoPlayer” "–save"
npm ERR! node v7.10.0
npm ERR! npm v4.2.0
npm ERR! code EISDIR
npm ERR! errno -21
npm ERR! syscall read

npm ERR! eisdir EISDIR: illegal operation on a directory, read
npm ERR! eisdir This is most likely not a problem with npm itself
npm ERR! eisdir and is related to npm not being able to find a package.json in
npm ERR! eisdir a package you are trying to install.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/biranchi/.npm/_logs/2017-05-31T02_59_37_928Z-debug.log


ionic info

Your system information:

Cordova CLI: 7.0.0
Ionic Framework Version: 3.1.1
Ionic CLI Version: 2.2.3
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.0
ios-deploy version: 1.9.1
ios-sim version: 5.0.13
OS: macOS Sierra
Node Version: v7.10.0
Xcode version: Xcode 8.3.2 Build version 8E2002

Can you try downgrading node to LTS 6.10.3?

In my case, I have node 6.10.3

The reason the YoutubeVideoPlayer is able to be downloaded is because of the repository. We have to wait for them to add a package.json file for it to be compatible with NPM. You can check out their pull request: https://github.com/JonSmart/CordovaYoutubeVideoPlayer/pull/3

They are trying to fix this. Hopefully soon.

I too had to same issue and just have to wait for them to update the repo.

1 Like

Thank for sharing this with us. Then we will have to wait.

You can also fork the repo, apply the Pull Request to your fork and install the Plugin via your fork directly from Github for now.

Wouldn’t downgrading to Cordova 6 be a potential stopgap measure?

1 Like