Node npm
This extension supports running npm scripts defined in the package.json file and validating the installed modules
against the dependencies defined in the package.json.
Notice The validation is done by running npm and it is not run when the modules are managed by yarn.
The package.json validation reports warnings for modules:
- that are defined in the package.json, but that are not installed
- that are installed but not defined in the package.json
- that are installed but do not satisfy the version defined in the package.json.
Quick fixes to run npm are provided for reported warnings.

Commands for running scripts are available the npm category.

- Run npm install, also available in the context menu of the explorer when the
package.jsonfile - Run a script (
npm run-script) defined in thepackage.jsonby picking a script
defined in thescriptssection of thepackage.json. - Rerun the last npm script you have executed using this extension.
- Terminate a running script
The scripts can be run either in the integrated terminal or an output window.
Support for Macbook Pro touch bar. You can run the following commands:
- npm install
- npm start
- npm test
- npm build

Settings
npm.validate.enablevalidate the dependencies in thepackage.jsonfile, the default istrue.npm.runInTerminaldefines whether the command is run
in a terminal window or whether the output form the command is shown in theOutputwindow. The default is to show the output in the terminal.npm.includeDirectoriesdefine additional directories that include apackage.json.npm.useRootDirectorydefine whether the root directory of the workspace should be ignored, the default isfalse.npm.runSilentrun npm commands with the--silentoption, the default isfalse.npm.bincustom npm bin name, the default isnpm.npm.enableTouchbarEnable the npm scripts on macOS touchbar.
Example
{
"npm.runInTerminal": false,
"npm.includeDirectories": [
"subdir1/path",
"subdir2/path"
]
}
Keyboard Shortcuts
The extension defines a chording keyboard shortcut for the R key. As a consequence an existing keybinding for R is not executed immediately. If this is not desired, then please bind another key for these commands, see the customization documentation.