Running npm command within Visual Studio Code
You can run npm commands directly in terminal (ctrl + `). Make sure that terminal has cmd.exe as the shell selected.
You can default cmd.exe as your shell by following these steps.
- ctrl+Shift+p
- Type > Select Default Shell + Enter
- Select > Command Prompt ...cmd.exe
- Restart VS Code.
Install
- Ctrl+P, write
ext install npm script runner
- Restart VS Code
Use (two ways)
- Ctrl+R Shift+R
- Ctrl+P, write
>npm
, selectrun script
, select the desired task
Update: Since version 1.3 Visual Studio Code has integrated terminal. To open it, use any of these methods:
- Use the Ctrl+` keyboard shortcut.
- Use the View | Toggle Integrated Terminal menu command.
- From the Command Palette (Ctrl+Shift+P), use the
View:Toggle Integrated Terminal
command.