您正在构建一个离子2应用程序,它显示了一些管视频内容,我研究了离子原生文档https://ionicframework.com/docs/native/youtube-video-player/
当我尝试安装此插件时
`ionic cordova plugin add https://github.com/JonSmart/CordovaYoutubeVideoPlayer`
我在控制台上收到错误
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: cmd: Command failed with exit code 4294963228 Error output:
npm ERR! addLocal Could not install C:\Users\***\AppData\Local\Temp\npm-1048-6f63d401\git-cache-cc20a6f9\2a0cc8f3790b584ed1aae3927d03f7213e90c9d0
npm ERR! Windows_NT 6.1.7600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\***\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "https://github.com/JonSmart/CordovaYoutubeVideoPlayer" "--save"
npm ERR! node v4.5.0
npm ERR! npm v3.9.0
npm ERR! code EISDIR
npm ERR! errno -4068
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.
我还在这里评论了git hub链接https://github.com/JonSmart/CordovaYoutubeVideoPlayer
但没有问题。
任何提示!谢谢!
答案 0 :(得分:0)
似乎有关于cordova插件和cordova version 7.0.0 +
的问题。
插件现在需要包含package.json。例如,检查this issue。
youtube插件没有package.json
我建议你将cordova版本降级到7.0.0以下,直到它被修复。
npm install -g cordova@version_number