Skip to content
npm Docs
npmjs.comStatusSupport
About npm
Getting started
Packages and modules
Integrations
Organizations
npm Enterprise
npm CLI
CLI Commands
npmnpm accessnpm addusernpm auditnpm binnpm bugsnpm buildnpm bundlenpm cachenpm cinpm completionnpm confignpm dedupenpm deprecatenpm dist-tagnpm docsnpm doctornpm editnpm explorenpm fundnpm helpnpm help-searchnpm hooknpm initnpm installnpm install-ci-testnpm install-testnpm linknpm logoutnpm lsnpm orgnpm outdatednpm ownernpm packnpm pingnpm prefixnpm profilenpm prunenpm publishnpm rebuildnpm reponpm restartnpm rootnpm run-scriptnpm searchnpm shrinkwrapnpm starnpm starsnpm startnpm stopnpm teamnpm testnpm tokennpm uninstallnpm unpublishnpm updatenpm versionnpm viewnpm whoami
Configuring npm
Using npm

npm-prefix

Display prefix
Version 6.x (LTS release)
  • Version 6.x (LTS release)
  • Version 7.x (Development release)
Table of contents
  • Synopsis
  • Description
  • See Also
Table of contents
  • Synopsis
  • Description
  • See Also

Synopsis

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 npm config for more detail.

See Also

  • npm root
  • npm bin
  • npm folders
  • npm config
  • npmrc