【问题标题】:Error when adding a cordova plugin添加cordova插件时出错
【发布时间】:2017-10-21 02:45:16
【问题描述】:

当我尝试将 cordova 插件添加到我的 ionic 项目时出现错误,我该如何解决?

我有科尔多瓦 7.0.1 和节点 6.10.1

$ cordova plugin add https://github.com/jcjee/email-composer.git
Error: Failed to fetch plugin https://github.com/jcjee/email-composer.git 
via re          gistry.
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\MEDANI~1\AppData\Local\Temp\npm-114          72-66e55b5f\git-cache-
0c87610f\2da028899216518447e10db238a14f1bef40acce
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program 
Files\\nodejs\\          node_modules\\npm\\bin\\npm-cli.js" "install" 
"https://github.com/jcjee/email-co          mposer.git" "--save"
npm ERR! node v6.10.1
npm ERR! npm  v3.10.10
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.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\Med Anis\desktop\mailtest\node_modules\npm-debug.log

【问题讨论】:

    标签: cordova ionic-framework cordova-plugins


    【解决方案1】:

    从 Cordova CLI 7 开始,所有插件都需要一个 package.json 文件,而该插件没有它。

    您可以使用plugman轻松创建package.json

    npm install -g plugman

    plugman createpackagejson /path/to/your/plugin

    会提示你输入现有plugin.xml上没有的插件信息

    然后您可以向插件作者发送 PR,这样其他人就不必这样做了

    猜你喜欢
    • 1970-01-01
    • 2016-09-08
    • 1970-01-01
    • 2014-05-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多