科尔多瓦/离子生成错误(有时):不具备必需的环境 [英] Cordova / Ionic build error (sometimes): don't have required environment
问题描述
我刚刚每次开始涉足科尔多瓦/离子实现Android / iOS的HTML5的/ JS应用程序,到目前为止,我已经得到了样本/教程的应用程序有时会工作,但并非如此。
I have just started dabbling in Cordova / Ionic to make Android / iOS apps with HTML5 / js, and so far I have gotten sample / tutorial apps to work sometimes, but not every time.
我在Windows上工作,我试图建立我的项目为Android现在。
I am working on Windows and am trying to build my projects for Android for now.
经过几次尝试,我不再能够建立我的应用程序,甚至完全空白模板的应用程序,我没有改变的。我试图通过科尔多瓦创建应用
After a couple tries, I am no longer able to build my apps, even completely "blank" template apps that I did not change at all. I tried creating apps via Cordova
cordova create hello com.example.hello HelloWorld
cd hello
cordova build android
或离子
ionic start test sidemenu
cd start
ionic build android
在这两种情况下,我得到了同样的错误:
In both cases I get the same error:
Running command: C:\Users\nthissen\Dropbox\Mobile\Projects\hello\platforms\andro
id\cordova\build.bat
events.js:85
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at exports._errnoException (util.js:746:11)
at Process.ChildProcess._handle.onexit (child_process.js:1046:32)
at child_process.js:1137:20
at process._tickCallback (node.js:355:11)
ERROR building one of the platforms: Error: C:\Users\nthissen\Dropbox\Mobile\Pro
jects\hello\platforms\android\cordova\build.bat: Command failed with exit code 1
You may not have the required environment or OS to build this project
是的,我已经安装了Android SDK和一切。奇怪的是:当我重新启动我的电脑,并立即尝试,它的工作原理没有问题,然后我甚至能够模拟/运行应用程序。后一对夫妇更尝试,编辑源$ C $ C等(我不太清楚是什么原因引起的),它停止工作,我甚至不能建立一个新创建的项目了。
Yes, I do have the Android SDK and everything installed. The strange thing is: when I restart my computer and try it immediately, it works without problems and I'm even able to emulate / run the app. After a couple more tries, edits to the source code, etc (I am not quite sure what's causing it), it stops working and I cannot even build a newly created project anymore.
这是怎么回事?为什么它在重启后的工作权利,但是停止工作看似随意的原因是什么?
What's going on? Why does it work right after a reboot, but stops working for seemingly random reason?
推荐答案
复制并粘贴此"%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\"你的环境变量路径,然后打开Android Studio或Eclipse中进行重建的一些项目进入环境,并尝试建立自己的科尔多瓦project.Hope它将帮助。这解决了我的问题。
Copy and paste this "%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\" to your enviroment variables Path and then open Android Studio or Eclipse make a rebuild to some project into the enviroment and try to build your cordova project.Hope it will help. That solve the problem for me.
这篇关于科尔多瓦/离子生成错误(有时):不具备必需的环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!