无法将推送通知插件添加到cordova中

时间:2014-04-30 15:26:07

标签: cordova push-notification

我刚刚创建了一个测试cordova项目,现在正尝试在我的项目中添加一个简单的Push Notification插件(https://github.com/phonegap-build/PushPlugin)。

我按照指示输入了这个:

cordova plugin add https://github.com/phonegap-build/PushPlugin.git

但是,命令行立即失败并显示以下错误消息:

F:\Workplace\pushnotification\pushnotification>cordova plugin add https://github.com/phonegap-build/PushPlugin.git
Fetching plugin "https://github.com/phonegap-build/PushPlugin.git" via git clone
Error: Command failed: fatal: could not create work tree dir 'C:\Users\FRANV_~1\AppData\Local\Temp\plugman\git\1398870928641'.: No such file or directory

    at ChildProcess.exithandler (child_process.js:637:15)
    at ChildProcess.EventEmitter.emit (events.js:98:17)
    at maybeClose (child_process.js:743:16)
    at Socket.<anonymous> (child_process.js:956:11)
    at Socket.EventEmitter.emit (events.js:95:17)
    at Pipe.close (net.js:465:12)

我刚刚更新了我的Tortoise GitHub,但它没有解决问题。

请帮我搞清楚。

谢谢

1 个答案:

答案 0 :(得分:5)

似乎Windows上的git源依赖项存在错误。

尝试手动创建目录:

mkdir C:\Users\FRANV_~1\AppData\Local\Temp\plugman\git\1398870928641

然后:

cordova plugin add https://github.com/phonegap-build/PushPlugin.git