简体   繁体   English

Windows8上的Cordova CLI找不到挂钩

[英]Cordova CLI on Windows8 can't find hooks

I'm trying to compile my phonegap project using the cordova cli on my Win8 machine. 我正在尝试在Win8机器上使用cordova cli编译phonegap项目。 I've updated all my Android SDKs, updated cordova and phonegap but I cannot build my project. 我已经更新了所有的Android SDK,更新了cordova和phonegap,但无法构建项目。 I get an error that the .cordova/hooks/any_hook is empty. 我收到一个错误消息:.cordova / hooks / any_hook为空。

I looked in that directory and can't see any files in there. 我查看了该目录,但看不到其中的任何文件。 How do those files get there and is the latest version of cordova bad? 这些文件如何到达那里,而科尔多瓦的最新版本不好? Until now I've been compiling on my Mac because I couldn't get the PC setup correctly so today I decided to take a crack at it and have failed. 直到现在,我一直在Mac上进行编译,因为无法正确安装PC,因此今天我决定对其进行破解,但失败了。

I even created a new hello world project using the CLI but still no luck in building the thing because of the supposed missing hook files. 我什至使用CLI创建了一个新的hello world项目,但由于应该缺少钩子文件,因此构建该项目仍然不走运。 Anyone have any insight to this.? 有人对此有任何见识吗?

Also, I've tried using the command prompt in both ADMIN and regular mode. 另外,我尝试在ADMIN和常规模式下都使用命令提示符。 Still no luck. 仍然没有运气。

EDIT: 编辑:

I'm using phonegap 3.3.0-4.18.0 我正在使用phonegap 3.3.0-4.18.0

Path to hooks: Z:\\projecttitleroot\\projecttitle.cordova\\hooks 钩子的路径:Z:\\ projecttitleroot \\ projecttitle.cordova \\ hooks

OUTPUT OF PHONEGAP BUILD WITH DEBUG: 带有调试的话音输出:

[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] compiling Android...
[error] ENOENT, no such file or directory 'Z:\myprojectroot\myproject\.cordova\hooks\before_build'

I want to point out that I'm using phonegap command to compile and run, NOT cordova as per the documentation for the latest version. 我想指出的是,我正在使用phonegap命令进行编译和运行,而不是按照最新版本的文档使用cordova。

If I run: 如果我运行:

cordova -d build android

I get this: 我得到这个:

Z:\myprojectroot\myproject>cordova -d build android

C:\Users\MYUSER\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:126
                    throw e;
                      ^
Error: ENOENT, no such file or directory 'Z:\myprojectroot\myproject\.cordova\hooks\before_build'    at Object.fs.readdirSync (fs.js:654:18)
at C:\Users\MYUSER\AppData\Roaming\npm\node_modules\cordova\src\hooker.js:64:34
at _fulfilled (C:\Users\MYUSER\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:798:54)
at self.promiseDispatch.done (C:\Users\MYUSER\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:827:30)
at Promise.promise.promiseDispatch (C:\Users\MYUSER\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:760:13)
at C:\Users\MYUSER\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:821:14
at flush (C:\Users\MYUSER\AppData\Roaming\npm\node_modules\cordova\node_modules\q\q.js:108:17)
at process._tickCallback (node.js:415:13)
at Function.Module.runMain (module.js:499:11)
at startup (node.js:119:16)

Z:\myprojectroot\myproject>

Make sure you put your hooks into subdirectories inside the hooks directory. 确保将挂钩放入hooks目录内的子目录中。

Path to hooks: Z:\\projecttitleroot\\projecttitle.cordova\\hooks\\before_build\\ 钩子的路径:Z:\\ projecttitleroot \\ projecttitle.cordova \\ hooks \\ before_build \\

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM