1

I'm under Windows 10 and I've installed the browser platform for Cordova for my Ionic app.

ionic cordova platform add browser 

Now I'd like to have a Run Configuration for the following command.

ionic cordova run browser --target=Firefox 

Adding a new configuration of type PhoneGap/Cordova to WebStorm with the desired parameters yields this message:

"C:\Program Files\JetBrains\WebStorm 2017.1.4\bin\runnerw.exe" C:\Users\Username\AppData\Roaming\npm\ionic.cmd run browser The run command has been renamed. To find out more, run: ionic cordova run --help 

Apparently WebStorm is using older commands.

Is there a workaround or a plugin fixing this? Or can you make a custom run configuration where you only execute a command in the terminal?

3 Answers 3

2

ionic 3 cli is not currently supported, and unfortunately there is no way to change the command - it's hardcoded:( Please follow (WEB-27402)[https://youtrack.jetbrains.com/issue/WEB-27402] for updates.

You can integrate cli as external tool, or use BashSupport plugin (https://plugins.jetbrains.com/plugin/4230-bashsupport) that supports generic run configurations that can be used to run any CLI tool

Sign up to request clarification or add additional context in comments.

Comments

2

I fixed this by saving the %APPDATA%\npm\ionic.cmd to ionic3.cmd and modifying the existing ionic.cmd to rewrite ionic 2 commands to be ionic 3 commands. Code below:

@echo off IF "%1" == "build" GOTO cordova IF "%1" == "compile" GOTO cordova IF "%1" == "emulate" GOTO cordova IF "%1" == "platform" GOTO cordova IF "%1" == "plugin" GOTO cordova IF "%1" == "prepare" GOTO cordova IF "%1" == "resources" GOTO cordova IF "%1" == "run" GOTO cordova GOTO ionic :ionic IF EXIST "%~dp0\node.exe" ( "%~dp0\node.exe" "%~dp0\node_modules\ionic\bin\ionic" %* ) ELSE ( SETLOCAL SET PATHEXT=%PATHEXT:;.JS;=;% node "%~dp0\node_modules\ionic\bin\ionic" %* ) GOTO end :cordova IF EXIST "%~dp0\node.exe" ( "%~dp0\node.exe" "%~dp0\node_modules\ionic\bin\ionic" cordova %* ) ELSE ( SETLOCAL SET PATHEXT=%PATHEXT:;.JS;=;% node "%~dp0\node_modules\ionic\bin\ionic" cordova %* ) GOTO end :end 

Comments

1

While waiting for the ionic3 support, you can try to create a %APPDATA%\npm\ionic3.cmd with the content %APPDATA%\npm\ionic.cmd cordova %* In the WebStorm Run/Debug configuration call the ionic3.cmd It worked for me Regards

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.