---
title: "Installation Methods"
description: "Review our alternate installation methods."
url: https://docs.sentry.io/platforms/javascript/guides/nitro/install/
---

# Installation Methods | Sentry for Nitro

## [How To Decide Which Installation Method To Use](https://docs.sentry.io/platforms/javascript/guides/nitro/install.md#how-to-decide-which-installation-method-to-use)

Most node applications today are either written in CommonJS (CJS), or compiled to CJS before running them. CommonJS uses `require()` to load modules. Our recommended installation method when using CommonJS is to require the `instrument.js` file at the top of your application. However, if your application is run in ESM mode, this will not work. In this case, you can follow the [ESM docs](https://docs.sentry.io/platforms/javascript/guides/nitro/install/esm.md).

Note that even if your application is written in ESM (using `import`), it may still be *run* in CJS. In this case, you should follow the [CommonJS instructions](https://docs.sentry.io/platforms/javascript/guides/nitro/install/commonjs.md).

### [My application is in TypeScript](https://docs.sentry.io/platforms/javascript/guides/nitro/install.md#my-application-is-in-typescript)

If you're using TypeScript, your application is likely compiled to CommonJS before running it. In this case, you should follow the [CommonJS instructions](https://docs.sentry.io/platforms/javascript/guides/nitro/install/commonjs.md).

### [My application uses `require`](https://docs.sentry.io/platforms/javascript/guides/nitro/install.md#my-application-uses-require)

If you are using `require()` in your application, you should follow the [CommonJS instructions](https://docs.sentry.io/platforms/javascript/guides/nitro/install/commonjs.md).

### [My application uses `import`](https://docs.sentry.io/platforms/javascript/guides/nitro/install.md#my-application-uses-import)

If you are using `import` in your application, your installation method depends on how your application is *run*. If you compile your application (e.g. into a `/dist` folder or similar) before running this, you need to check how the compiled code looks like. Is the compiled code using `require`? Then you should follow the [CommonJS instructions](https://docs.sentry.io/platforms/javascript/guides/nitro/install/commonjs.md). If the compiled code is using `import`, you should follow the [ESM instructions](https://docs.sentry.io/platforms/javascript/guides/nitro/install/esm.md).

If you do not compile your code, you'll need to follow the [ESM instructions](https://docs.sentry.io/platforms/javascript/guides/nitro/install/esm.md).

### [I don't need automatic spans/transactions](https://docs.sentry.io/platforms/javascript/guides/nitro/install.md#i-dont-need-automatic-spanstransactions)

If you don't need spans emitted by OpenTelemetry instrumentation, you can use `@sentry/node-core` in [Lightweight Mode](https://docs.sentry.io/platforms/javascript/guides/nitro/install/lightweight.md) without OpenTelemetry dependencies. You still get errors, logs, metrics, breadcrumbs, and more. This mode is experimental.
