Nuke Dependencies
Functions
Section titled “Functions”nukeDependencies()
Section titled “nukeDependencies()”function nukeDependencies(packageRoot?): Promise<void>;Defined in: functions/nukeDependencies.ts:28
Helper function to:
- delete the “node_modules” directory
- delete any package manager lock files that exist
- reinstall the dependencies using the detected package manager (defaulting to npm if there was no detected package manager)
This will attempt to validate that the directory is correct by looking for a “package.json” file. If not found, this function will print an error message and exit.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
packageRoot? |
string |
The path to the directory that contains the “package.json” file and the “node_modules” directory. If undefined is passed, the current working directory will be used. |
Returns
Section titled “Returns”Promise<void>
Whether any dependencies were updated.
Throws
Section titled “Throws”If the “package.json” file cannot be found.
