Install from the command line: code --install-extension pinterest.package-watcher
Search for Package Watcher in the VS Code extensions panel
Requirements
Use either npm or yarn in your project
A node_modules directory
Extension Settings
Setting
Type (default)
Description
packageWatcher.enableTelemetry
boolean (true)
Enable/disable telemetry
packageWatcher.mode
enum: 'auto', 'request' ('auto')
auto runs the extension in the background and automatically runs yarn/npm install. requestnotifies you when a change in a package lock file is detected and asks you to install new depedencies.
Activate if there are 1 or multiple package.json file(s) within the workspace.
Watch for changes to yarn.lock or package-lock.json files.
When there are changes, ensure a sibling node_modules directory already exists. If not, don't do anything.
When a node_modules directory exist either:
Ping the user to run the install command: request mode
Automatically run the install command: auto mode
How does the monorepo support work?
We only run the install command in directories which have a node_modules directory. If that doesn't exist, we will not run the package install command.
The extension doesn't seem to work, what can I do to debug?
Validate the following:
package.json exists in the VSCode workspace.
yarn.lock or package-lock.json file exists in the VSCode workspace.
node_modules directory lives next to the package.json directory.
Then restart your editor and copy/paste the output in the Package Watcher output log. You can see this log by clicking on Package Watcher in the status bar.