Install specific version of Cordova CLI in Visual Studio 2017

让人想犯罪 __ 提交于 2019-11-28 00:21:16
Elvis Xia - MSFT

I don't see any updates to TACO in VS2017 or instructions in the Microsoft documentation for Apache Cordova Tools.

You can follow below steps to use the latest cordova-ios:

  1. Open config.xml with designer
  2. Toolset->Check the checkbox of Take latest patch(requires internet) on cordova-ios row.

Update:

If you don't see the checkbox in the designer page, you need to change it in the xml. Find the following tag in config.xml:

<engine name="ios" spec="4.2.0" />

and modify it to:

<engine name="ios" spec="~4.2.0" />

Update2:

If the version is still not update to the latest, please try the below steps to fix the issue:

  1. Clear the cordova cache under: Tools->Options->Tools for Apache Cordova->Clear Cordova cache.
  2. Open cmd of your project folder;
  3. Type npm install -g cordova-ios to install globally the cordova-ios(requires node installed as pre-work);
  4. Then cordova platform rm ios;
  5. Type cordova platform add ios;
  6. Run your project again

For iOS, please install iOS@4.3.1. This is the only version i found working with XCode 8.3.3

I had the same error, follow this steps :

1- If not installed yet, install Node

2- Install the latest version of cordova or anyother:

npm install -g cordova

3- Install taco-cli:

npm install -g taco-cli

4- Configure taco-cli :

taco remote add ios

(respond a few question, MAC IP, Port,etc...)

5- in your root project add or edit a file named "taco.json", add inside :

{
    "cordova-cli": "7.1.0"
}

Where 7.1.0 correspond to your cordova version (cordova --v)

6- Try to emulate on your MAC:

taco emulate ios

You will maybe have an error about platform. Ignore it

7- Close then open Visual Studio

8- On Visual Studio open the config.xml UI EDITOR and change the toolset name with

Global cordova

9- Build using Visual Studio.

If it doesn't work, please let me know

I don't have the authority to add a comment to the answer above, so adding my updates here:

If the version is still not update to the latest, please try the below steps to fix the issue:

First, modify your project config.xml file using an editor, rather than through the tools. Not sure why it was necessary, but this was the key difference from the above instructions. I also found that 4.3.1 was best. Remove any ~ characters before the version.

Then:

  1. Clear the cordova cache under: Tools->Options->Tools for Apache Cordova->Clear Cordova cache.

  2. Open cmd of your project folder

  3. Type npm install -g cordova-ios to install globally the cordova-ios(requires node installed as pre-work)

  4. Then cordova platform rm ios

  5. Type cordova platform add ios

  6. Run your project again

If the cordova command in steps 4 and 5 doesn't work, add the cordova bin directory to you path. In my case

C:\ProgramData\Microsoft\VisualStudio\MDA\ad0a0856\taco-toolset-6.3.1\node_modules.bin\

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