Skip to main content

Nuke Dependencies

Functions

nukeDependencies()

function nukeDependencies(packageRoot): void

Helper function to:

  • delete the "node_modules" folder
  • delete any package manager lock files that exist
  • reinstall the dependencies using the 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

ParameterTypeDescription
packageRootundefined | stringThe path to the directory that contains the "package.json" file and the "node_modules" folder. If undefined is passed, the current working directory will be used.

Returns

void

Whether any dependencies were updated.

Defined in

packages/complete-node/src/functions/nukeDependencies.ts:25