2019-11-05 14:55:08 -05:00
|
|
|
---
|
|
|
|
title: npm-prefix
|
2020-11-01 07:54:36 +01:00
|
|
|
section: 1
|
2019-11-05 14:55:08 -05:00
|
|
|
description: Display prefix
|
|
|
|
---
|
|
|
|
|
|
|
|
### Synopsis
|
|
|
|
|
|
|
|
```bash
|
|
|
|
npm prefix [-g]
|
|
|
|
```
|
|
|
|
|
|
|
|
### Description
|
|
|
|
|
|
|
|
Print the local prefix to standard out. This is the closest parent directory
|
|
|
|
to contain a `package.json` file or `node_modules` directory, unless `-g` is
|
|
|
|
also specified.
|
|
|
|
|
|
|
|
If `-g` is specified, this will be the value of the global prefix. See
|
2020-11-01 07:54:36 +01:00
|
|
|
[`npm config`](/commands/npm-config) for more detail.
|
2019-11-05 14:55:08 -05:00
|
|
|
|
|
|
|
### See Also
|
|
|
|
|
2020-11-01 07:54:36 +01:00
|
|
|
* [npm root](/commands/npm-root)
|
|
|
|
* [npm bin](/commands/npm-bin)
|
2019-11-05 14:55:08 -05:00
|
|
|
* [npm folders](/configuring-npm/folders)
|
2020-11-01 07:54:36 +01:00
|
|
|
* [npm config](/commands/npm-config)
|
2019-11-05 14:55:08 -05:00
|
|
|
* [npmrc](/configuring-npm/npmrc)
|