# Manage External Dependencies

OXIDE comes with built-in package management for external dependencies. Node.js packages can be added as dependencies and [used within views](https://docs.journeyapps.com/reference/build/syntax/typescript-apps#npm-packages) (TS apps only), within [App packages](https://docs.journeyapps.com/reference/build/extending-your-app-with-custom-code/app-packages/app-packages-overview) (TS apps only), and within [CloudCode](https://docs.journeyapps.com/reference/cloudcode/cloudcode-overview).

Dependencies can be managed in two ways:

1. They can be added using OXIDE's UI
2. They can be added and edited by updating `package.json` directly

## Add dependencies using OXIDE's UI

The easiest way to add a Node.js package to your app is by firing the Add **Node.js package** action from the command palette.&#x20;

OXIDE will then prompt you to select your target for the dependency:

* Select the global "App package" to add a dependency that needs to be imported from your app's views (TS apps only)
* Or select the specific app package (TS apps only) or CloudCode task

Within CloudCode tasks and App packages, OXIDE also presents a dependencies node which can be right-clicked to add a Node.js package directly.

After selecting the target, OXIDE will prompt you with an NPM search box:

<figure><img src="https://2865107717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9TCHLR67eLHBOjPvHhud%2Fuploads%2FC7rVzabVud69ytDFN7FK%2FScreenshot%202023-02-09%20at%201.05.19%20PM.png?alt=media&#x26;token=969a7d7e-e576-4d2b-9c50-f2b763bbd0a9" alt=""><figcaption></figcaption></figure>

From here you can search for any NPM package and selecting one will start the process of adding it to the target and updating its corresponding `yarn.lock` file in the background. OXIDE will confirm when `yarn.lock` has been updated successfully. After that point, you can start using the dependency.

## Add/update dependencies using package.json

If you are more experienced with the Node.js ecosystem, you can edit the `package.json` file directly.

{% hint style="success" %}
**Prerequisite:** Make sure you have the **Show configuration files** setting enabled.
{% endhint %}

Navigate to and open the `package.json` file as follows:

* App-level `package.json` (TS apps only):  Expand to the *Other* section in the App Tree panel. By default, this panel is included in OXIDE's Overview workspace.
* App package (TS apps only) or CloudCode task: Expand the file tree for an app package or CloudCode task:&#x20;

![](https://2865107717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9TCHLR67eLHBOjPvHhud%2Fuploads%2Fgit-blob-2c772dea100f7fa87b2201402264610528a6bdf0%2Foxide-browser-package-json.png?alt=media)

{% hint style="info" %}
**Tip**: These files can also be found by using the **Open file** action.
{% endhint %}

Once the `package.json` file is open, locate the dependencies section. If the section does not exist, it will be available via autocomplete:

![](https://2865107717-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9TCHLR67eLHBOjPvHhud%2Fuploads%2Fgit-blob-d3156d75801405c2a15201799dfe9e80902989a7%2Foxide-file-package-json.png?alt=media)

Make the necessary edits and then run the **Update yarn.lock** action by right-clicking on the app package or CloudCode task, or by firing this action directly from the command palette.
