如何在Visual Studio中运行Cordova / Ionic的命令? [英] How to run commands for Cordova/Ionic in Visual Studio?

查看:167
本文介绍了如何在Visual Studio中运行Cordova / Ionic的命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图找出在Visual Studio中使用Cordova / Ionic时如何运行所有花哨的命令行命令,我无法弄明白。我创建了Ionic项目,它在Visual Studio中可以正常工作,但有些东西不受支持(Ionic或Cordova提供的各种命令)。例如。我想运行这个:

I am trying to figure out how do you run all the fancy command line commands when working with Cordova / Ionic in Visual Studio and I cannot really figure it out. I have created Ionic project and it works just fine with what is possible in Visual Studio, but there are things that are not supported (various commands that Ionic or Cordova provide). E.g. I want to run this:

ionic serve --lab

或者这个:

cordova serve

我无法确定在哪里运行它?我试过普通的命令行,但它不起作用。我应该怎么做才能使这个运行?

I cannot really figure out where to run this? I tried ordinary command line, but it does not work. What should I do to make this run?

推荐答案

Visual Studio没有内置的命令行集成。因此,您必须使用正常的命令提示符来使用CLI命令。你是如何安装ionic / cordova的?如果您使用npm -g install ionic从NPM安装,那么它应该已经在您的路径中从任何地方运行它。否则,您可能需要将其添加到您的路径中。通常你会在%appdata%/ roaming / npm / npm_modules下找到你的Cordova / Ionic。

Visual studio doesn't have a command line integration built into it. So you would have to use your normal command prompt to use your CLI commands. How did you install ionic/cordova? If you installed in from NPM, using "npm -g install ionic", then it should already be in your path to run it from anywhere. Else you might have to add it into your path. Typically you would find your Cordova/Ionic under %appdata%/roaming/npm/npm_modules.

通常这里是在VS中使用Ionic / Cordova项目的指南

Typically here is the guidance for using Ionic/Cordova projects in VS


  1. 安装离子npm install -g ionic

  2. 创建项目ionic start myApp

  3. cd到项目cd [path] \ myApp

  4. ionic serve

  5. 对于VS -

  1. Install ionic "npm install -g ionic"
  2. Create a project "ionic start myApp"
  3. cd to the project "cd [path]\myApp"
  4. ionic serve
  5. For VS -


  1. 打开VS并选择文件 - >新建 - >从现有项目创建

  2. 将路径指向[path] \ myApp:这将创建一个VS Cordova项目

  3. 在VS中运行/构建/调试项目。


  • 对任何Ionic命令使用命令提示符。

  • Use you command prompt for any Ionic commands.

    这篇关于如何在Visual Studio中运行Cordova / Ionic的命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆