1--- 2section: cli-commands 3title: npm-prefix 4description: Display prefix 5--- 6 7# npm-prefix(1) 8 9## Display prefix 10 11### Synopsis 12 13```bash 14npm prefix [-g] 15``` 16 17### Description 18 19Print the local prefix to standard out. This is the closest parent directory 20to contain a `package.json` file or `node_modules` directory, unless `-g` is 21also specified. 22 23If `-g` is specified, this will be the value of the global prefix. See 24[`npm config`](/cli-commands/npm-config) for more detail. 25 26### See Also 27 28* [npm root](/cli-commands/npm-root) 29* [npm bin](/cli-commands/npm-bin) 30* [npm folders](/configuring-npm/folders) 31* [npm config](/cli-commands/npm-config) 32* [npmrc](/configuring-npm/npmrc) 33