Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
npm-prefix.md59 linesDownload Raw Back to commands
1---
2title: npm-prefix
3section: 1
4description: Display prefix
5---
6
7### Synopsis
8
9```bash
10npm prefix
11```
12
13Note: This command is unaware of workspaces.
14
15### Description
16
17Print the local prefix to standard output.
18This is the closest parent directory to contain a `package.json` file or `node_modules` directory, unless `-g` is also specified.
19
20If `-g` is specified, this will be the value of the global prefix.
21See [`npm config`](/commands/npm-config) for more detail.
22
23### Example
24
25```bash
26npm prefix
27/usr/local/projects/foo
28```
29
30```bash
31npm prefix -g
32/usr/local
33```
34
35### Configuration
36
37#### `global`
38
39* Default: false
40* Type: Boolean
41
42Operates in "global" mode, so that packages are installed into the `prefix`
43folder instead of the current working directory. See
44[folders](/configuring-npm/folders) for more on the differences in behavior.
45
46* packages are installed into the `{prefix}/lib/node_modules` folder, instead
47  of the current working directory.
48* bin files are linked to `{prefix}/bin`
49* man pages are linked to `{prefix}/share/man`
50
51
52
53### See Also
54
55* [npm root](/commands/npm-root)
56* [npm folders](/configuring-npm/folders)
57* [npm config](/commands/npm-config)
58* [npmrc](/configuring-npm/npmrc)
59 
codekingpro/portable-devtools · Team Ai