Cordova CLI Windows - ENOENT error when executing cordova platform add android

心不动则不痛 提交于 2019-12-11 16:58:53

问题


I installed openssh, and I suspect that removes my Path from environment variables. Since then, I got this following error.

What caused this?

cordova info outputs this:

Node version: v6.12.3    

Cordova version: 7.0.0

Config.xml file:

<?xml version='1.0' encoding='utf-8'?>
<widget id="io.cordova.hellocordova" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
    <name>HelloCordova</name>
    <description>
        A sample Apache Cordova application that responds to the deviceready event.
    </description>
    <author email="dev@cordova.apache.org" href="http://cordova.io">
        Apache Cordova Team
    </author>
    <content src="index.html" />
    <plugin name="cordova-plugin-whitelist" spec="1" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />
    <platform name="android">
        <allow-intent href="market:*" />
    </platform>
    <platform name="ios">
        <allow-intent href="itms:*" />
        <allow-intent href="itms-apps:*" />
    </platform>
</widget>


No Plugins Currently Installed

No Platforms Currently Installed

I added JAVA_HOME and ANDROID_HOME in my environment variables. But still same error


回答1:


Yes, this is a problem in my PATH variable. OpenSSH installation removes default value. All I need was adding %SystemRoot%\system32; %SystemRoot%; %SystemRoot%\System32\Wbem; to my PATH



来源:https://stackoverflow.com/questions/48397839/cordova-cli-windows-enoent-error-when-executing-cordova-platform-add-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!