# Dependencies from package.json are missing after install

**Author:** DX Team

---

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`.

`{ "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:

`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)):

`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)):

`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)):

`yarn install --production=false`

---

[View full KB sitemap](/kb/sitemap.md)
