Skip to content

Nuke Dependencies

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.

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.

Promise<void>

Whether any dependencies were updated.

If the “package.json” file cannot be found.