'cordova' is not recognized as an internal or external command

若如初见. 提交于 2019-12-14 03:16:30

问题


I am trying to install cordova 5.1.1 version using node.js, Command line interface.

cordova got installed on the machine, but I am not able to use cordova command. When I list the packages, I can able to see installed cordova cordova, but can not run command to create project.

System config : OS : windows 8, npm version : 1.3.21, Cordova version : 5.1.

Error Message

C:>cordova

'cordova' is not recognized as an internal or external command, operable program or batch file.


回答1:


Need to set environment variable.

Start -> Control Panel -> System and Security -> System -> Environment variables

or

Mycomputer -> Right Click -> properties -> Advance System settings -> Environment variables

under User variables for youruser:

Path: %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT% \System32\WindowsPowerShell\v1.0\;C:\Users\user1\AppData\Roaming\npm`

Temp: %USERPROFILE%\AppData\Local\Temp Simple copy pasting wont work.

If Still Not getting need reset/create the DWORD

1.Click the Start menu and type "regedit" on the search box. This will launch the Windows Registry Editor program.

2.Enter to the following Registry entry: HKEY_CURRENT_USER\Software\Microsoft\Windows Script Host\Settings

3.Select the "Enabled" entry in the right side window. If this entry is there, right-click and select "New" followed by "DWORD Value." Name the value "Enabled."

4.Right-click the "Enabled" entry and click "Modify."

5.Change the number in the "Value" box to "1." This will re-enable WSH.

6.close all opened cmd windows and open a new window.




回答2:


Path set to Environment variable where Cordova install

$ which cordova node_modules/.bin $ cordova -v 3.5.0-0.2.4



来源:https://stackoverflow.com/questions/31352527/cordova-is-not-recognized-as-an-internal-or-external-command

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