npm tasks 'dev' and 'build' not available in 0.15
-
I use PHPStorm as IDE. With the previous version of Quasar I could use the built-in npm taskrunner, to start ‘dev’ or ‘build’.
With 0.15 only the npm tasks ‘lint’ and ‘test’ are available. I have to do ‘quasar dev’ from the command-line to run my app, but I prefer being able to do this from within PHPStorm.
Any workaround for this ?
-
There are multiple possibilities:
First one ist to simply edit your
package.json
file and under the scripts section add the following:"scripts": { "lint": "eslint --ext .js,.vue src", "test": "echo \"No test specified\" && exit 0", "dev": "quasar dev", "build": "quasar build" }
This allows you to call
npm run dev
which the runsquasar dev
(assuming quasar-cli is globally installed)Second option ist to add an run configuration like described here: https://www.jetbrains.com/help/phpstorm/creating-and-editing-run-debug-configurations.html#createExplicitly
-
@a47ae perfect, thank you
-
One more question, when I try to run ‘quasar build -m cordova -T android’, it complains that ‘cordova’ is not recognized as an internal or external command. This is probably because of the fact that cordova needs to be run as an administrator (I use Windows). Any idea how to force npm (or quasar) to be run as an Administrator ?
-
Ist this a general problem with the
Quasar build -m cordova -T android
command or only if you put it in your npm script section?If it is only in npm I would suspect this is due to npm interpreting “cordova” not as a flag but as a command. Try to just write
quasar build
in your scripts section (assuming the command name is build) and runnpm run build — -m cordova -T android
(the—
is intentional to escape the arguments)Edit: the code above is a bit hard to read with the forum font,
npm run build
has to be followed by two-
-
Found the solution for this problem: running PHPStorm as administrator solved it. You can check this in the shortcut of PHPStorm under ‘Advanced’.
-
Nice, thanks for sharing this!
-
( this is same question with bobdylan, other thing is I use VS Code)
I use VS code as IDE. With the previous version of Quasar I could use the built-in debugger/npm taskrunner, to start ‘dev’ or ‘build’.
With 0.15 only the npm tasks ‘lint’ and ‘test’ are available. I have to do ‘quasar dev’ from the command-line to run my app, but I prefer being able to do this from within VS Code.
Any workaround for this ?
-
I use PHPStorm as IDE. With the previous version of Quasar I could use the built-in npm taskrunner, to start ‘dev’ or ‘build’.
With 0.15 only the npm tasks ‘lint’ and ‘test’ are available. I have to do ‘quasar dev’ from the command-line to run my app, but I prefer being able to do this from within PHPStorm.
Any workaround for this ?
-
@terry you can always add custom console runners in php storm. just check their documentation…
-
thanks @Max, will try as you comment with both PHPStorm and VS Code