---
title: Dependencies from package.json are missing after install
description: Understand why dependencies may not being installed during a build and how to fix.
url: /kb/guide/dependencies-from-package-json-missing-after-install
canonical_url: "https://vercel.com/kb/guide/dependencies-from-package-json-missing-after-install"
published: 2025-11-04
last_updated: 2025-11-17
authors: DX Team
related:
  - /docs/package-managers
  - /docs/deployments/configure-a-build
install_vercel_plugin: npx plugins add vercel/vercel-plugin
---
<!-- docsgraph:related -->
## Related pages

> **For AI agents:** Follow these links to understand how this page connects to the rest of the Vercel ecosystem. For the full cross-link map (inbound, outbound, prerequisites, and semantic neighbors), see the .graph.md link below.

- [Advanced Node.js Usage](https://vercel.com/docs/functions/runtimes/node-js/advanced-node-configuration?from=related) — Learn about advanced configurations for Vercel functions on Vercel.
- [Build Features](https://vercel.com/docs/builds/build-features?from=related) — Learn how to customize your deployments using Vercel's build features.
- [Troubleshoot Build Errors](https://vercel.com/docs/deployments/troubleshoot-a-build?from=related) — Learn how to resolve common scenarios you may encounter during the Build step, including build errors that cancel a depl
- [Manage Across Environments](https://vercel.com/docs/environment-variables/manage-across-environments?from=related) — Add, sync, and verify environment variables across development, preview, production, and custom environments using the C
- [Build System](https://vercel.com/docs/fundamentals/builds?from=related) — Learn how Vercel transforms your source code into optimized assets ready to serve globally.
- [How do I use private dependencies with Vercel?](https://vercel.com/kb/guide/using-private-dependencies-with-vercel?from=related) — Information on how to use private dependencies with a Vercel deployment.
- [How do I use the latest npm version for my Vercel Deployment?](https://vercel.com/kb/guide/how-do-i-use-the-latest-npm-version-for-my-vercel-deployment?from=related) — Learn how to use the latest npm version for Vercel deployments.
- [How do I resolve a 'module not found' error?](https://vercel.com/kb/guide/how-do-i-resolve-a-module-not-found-error?from=related) — Information on resolving a 'module not found' error.
- [Why does my Serverless Function work locally but not when deployed?](https://vercel.com/kb/guide/why-does-my-serverless-function-work-locally-but-not-when-deployed?from=related) — Learn how to troubleshoot your Serverless Functions.
- [How do I use the "Ignored Build Step" field on Vercel?](https://vercel.com/kb/guide/how-do-i-use-the-ignored-build-step-field-on-vercel?from=related) — Instructions on how to use the "Ignored Build Step" field to programmatically prevent a new deployment from being built.

Full cross-link map for this page: [/kb/guide/dependencies-from-package-json-missing-after-install.graph.md](/kb/guide/dependencies-from-package-json-missing-after-install.graph.md)
<!-- /docsgraph:related -->


For Node.js projects it is a common practice to store external dependencies for a project in `package.json` file. These dependencies are managed by the package manager of your choice ([See supported package managers on Vercel](/docs/package-managers#supported-package-managers)) and are installed automatically during a build on Vercel.

A typical `package.json` file splits dependencies between `dependencies` and `devDependencies`. The convention is to list runtime dependencies under `dependencies` and build-time dependencies under `devDependencies`.

```json
{
  "name": "my-app",
  "dependencies": {
    "next": "latest",
    "react": "latest",
    "react-dom": "latest"
  },
  "devDependencies": {
    "@types/node": "latest",
    "@types/react": "latest",
    "typescript": "latest"
  }
}
```

## Dependencies missing during build

Vercel installs the dependencies defined in your `package.json` at the start of your build. However, depending on your project configuration, some dependencies might not get installed.

For example, dependencies listed in the `devDependencies` section might be missing, leading to an error like this:

```plain
It looks like you're trying to use TypeScript but do not have the required package(s) installed.

Please install typescript and @types/node by running:
npm install --save-dev typescript @types/node
```

Even though you defined the missing dependencies in the `devDependencies` section of your `package.json`, they might not be resolved during the build.

## Impact of environment variable `NODE_ENV` on dependency installation

Many package managers offer a production mode for their install command, which installs only the dependencies listed under `dependencies`, ignoring those in `devDependencies`.

You can enable production mode by passing a flag to the install command, or it activates automatically when the `NODE_ENV=production` environment variable is set.

Setting this environment variable in your project settings makes it available during both the build phase and when running your app on Vercel.

If `NODE_ENV` is set in the project settings, it will be available during dependency installation, which may trigger production mode.

## Solution: Use a custom install command for dependency installation

Removing the `NODE_ENV` environment variable from the project settings would resolve this issue, but there may be cases where you want to keep it.

In such cases, you can prevent the package manager from using production mode during installation by modifying the Install Command in your project's [Build & Development Settings](/docs/deployments/configure-a-build#build-and-development-settings).

Depending on the package manager you are using in your project you have to use a different command:

### Disable production mode for npm

To disable the production mode for the [npm CLI](https://docs.npmjs.com/cli), you have to add the flag `--production=false` to the install command ([documentation](https://docs.npmjs.com/cli/v10/commands/npm-install)):

```bash
npm install --production=false
```

### Disable production mode for pnpm

To disable the production mode for [pnpm](https://pnpm.io/), you have to add the flag `--prod=false` to the install command ([documentation](https://pnpm.io/cli/install#--prod--p)):

```bash
pnpm install --prod=false
```

### Disable production mode for Yarn

To disable the production mode for [Yarn](https://classic.yarnpkg.com/), you have to add the flag `--production=false` to the install command ([documentation](https://classic.yarnpkg.com/en/docs/cli/install#toc-yarn-install-production-true-false)):

```bash
yarn install --production=false
```