Go to main content

man pages section 1: User Commands

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

npm-root (1)

Name

npm-root - Display npm root Synopsis npm root Description Print the effective node_modules folder to standard out. Useful for using npm in shell scripts that do things with the node_mod- ules folder. For example: #!/bin/bash global_node_modules="$(npm root --global)" echo "Global packages installed in: ${global_node_modules}" Configuration global o Default: false o Type: Boolean Operates in "global" mode, so that packages are installed into the pre- fix folder instead of the current working directory. See npm help fold- ers for more on the differences in behavior. o packages are installed into the {prefix}/lib/node_modules folder, instead of the current working directory. o bin files are linked to {prefix}/bin o man pages are linked to {prefix}/share/man See Also o npm help prefix o npm help bin o npm help folders o npm help config o npm help npmrc

Synopsis

Please see following description for synopsis

Description

NPM-ROOT(1)                                                        NPM-ROOT(1)



NAME
       npm-root - Display npm root

   Synopsis
         npm root

   Description
       Print the effective node_modules folder to standard out.

       Useful for using npm in shell scripts that do things with the node_mod-
       ules folder.  For example:

         #!/bin/bash
         global_node_modules="$(npm root --global)"
         echo "Global packages installed in: ${global_node_modules}"

   Configuration
   global
       o Default: false

       o Type: Boolean


       Operates in "global" mode, so that packages are installed into the pre-
       fix folder instead of the current working directory. See npm help fold-
       ers for more on the differences in behavior.

       o packages are installed  into  the  {prefix}/lib/node_modules  folder,
         instead of the current working directory.

       o bin files are linked to {prefix}/bin

       o man pages are linked to {prefix}/share/man


   See Also
       o npm help prefix

       o npm help bin

       o npm help folders

       o npm help config

       o npm help npmrc




ATTRIBUTES
       See attributes(7) for descriptions of the following attributes:


       +---------------+--------------------------+
       |ATTRIBUTE TYPE |     ATTRIBUTE VALUE      |
       +---------------+--------------------------+
       |Availability   | runtime/nodejs/nodejs-18 |
       +---------------+--------------------------+
       |Stability      | Pass-thru volatile       |
       +---------------+--------------------------+

NOTES
       Source  code  for open source software components in Oracle Solaris can
       be found at https://www.oracle.com/downloads/opensource/solaris-source-
       code-downloads.html.

       This     software     was    built    from    source    available    at
       https://github.com/oracle/solaris-userland.   The  original   community
       source    was   downloaded   from    https://github.com/nodejs/node/ar-
       chive/v18.1.0.zip.

       Further information about this software can be found on the open source
       community website at https://github.com/nodejs/node.



                                  April 2022                       NPM-ROOT(1)