????
Current Path : /proc/thread-self/root/lib/node_modules/npm/docs/output/commands/ |
Current File : //proc/thread-self/root/lib/node_modules/npm/docs/output/commands/npm.html |
<html><head> <title>npm</title> <style> body { background-color: #ffffff; color: #24292e; margin: 0; line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; } #rainbar { height: 10px; background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff); } a { text-decoration: none; color: #0366d6; } a:hover { text-decoration: underline; } pre { margin: 1em 0px; padding: 1em; border: solid 1px #e1e4e8; border-radius: 6px; display: block; overflow: auto; white-space: pre; background-color: #f6f8fa; color: #393a34; } code { font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; font-size: 85%; padding: 0.2em 0.4em; background-color: #f6f8fa; color: #393a34; } pre > code { padding: 0; background-color: inherit; color: inherit; } h1, h2, h3 { font-weight: 600; } #logobar { background-color: #333333; margin: 0 auto; padding: 1em 4em; } #logobar .logo { float: left; } #logobar .title { font-weight: 600; color: #dddddd; float: left; margin: 5px 0 0 1em; } #logobar:after { content: ""; display: block; clear: both; } #content { margin: 0 auto; padding: 0 4em; } #table_of_contents > h2 { font-size: 1.17em; } #table_of_contents ul:first-child { border: solid 1px #e1e4e8; border-radius: 6px; padding: 1em; background-color: #f6f8fa; color: #393a34; } #table_of_contents ul { list-style-type: none; padding-left: 1.5em; } #table_of_contents li { font-size: 0.9em; } #table_of_contents li a { color: #000000; } header.title { border-bottom: solid 1px #e1e4e8; } header.title > h1 { margin-bottom: 0.25em; } header.title > .description { display: block; margin-bottom: 0.5em; line-height: 1; } footer#edit { border-top: solid 1px #e1e4e8; margin: 3em 0 4em 0; padding-top: 2em; } </style> </head> <body> <div id="banner"> <div id="rainbar"></div> <div id="logobar"> <svg class="logo" role="img" height="32" width="32" viewBox="0 0 700 700"> <polygon fill="#cb0000" points="0,700 700,700 700,0 0,0"></polygon> <polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150"></polygon> </svg> <div class="title"> npm command-line interface </div> </div> </div> <section id="content"> <header class="title"> <h1 id="npm">npm</h1> <span class="description">javascript package manager</span> </header> <section id="table_of_contents"> <h2 id="table-of-contents">Table of contents</h2> <div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#version">Version</a></li><li><a href="#description">Description</a></li><li><a href="#important">Important</a></li><li><a href="#introduction">Introduction</a></li><li><a href="#dependencies">Dependencies</a></li><li><a href="#directories">Directories</a></li><li><a href="#developer-usage">Developer Usage</a></li><ul><li><a href="#configuration">Configuration</a></li></ul><li><a href="#contributions">Contributions</a></li><li><a href="#bugs">Bugs</a></li><li><a href="#author">Author</a></li><li><a href="#see-also">See Also</a></li></ul></div> </section> <div id="_content"><h3 id="synopsis">Synopsis</h3> <pre lang="bash"><code>npm <command> [args] </code></pre> <h3 id="version">Version</h3> <p>6.14.18</p> <h3 id="description">Description</h3> <p>npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency conflicts intelligently.</p> <p>It is extremely configurable to support a wide variety of use cases. Most commonly, it is used to publish, discover, install, and develop node programs.</p> <p>Run <code>npm help</code> to get a list of available commands.</p> <h3 id="important">Important</h3> <p>npm is configured to use npm, Inc.’s public registry at <a href="https://registry.npmjs.org">https://registry.npmjs.org</a> by default. Use of the npm public registry is subject to terms of use available at <a href="https://www.npmjs.com/policies/terms">https://www.npmjs.com/policies/terms</a>.</p> <p>You can configure npm to use any compatible registry you like, and even run your own registry. Use of someone else’s registry may be governed by their terms of use.</p> <h3 id="introduction">Introduction</h3> <p>You probably got npm because you want to install stuff.</p> <p>Use <code>npm install blerg</code> to install the latest version of “blerg”. Check out <a href="../commands/npm-install.html"><code>npm install</code></a> for more info. It can do a lot of stuff.</p> <p>Use the <code>npm search</code> command to show everything that’s available. Use <code>npm ls</code> to show everything you’ve installed.</p> <h3 id="dependencies">Dependencies</h3> <p>If a package references to another package with a git URL, npm depends on a preinstalled git.</p> <p>If one of the packages npm tries to install is a native node module and requires compiling of C++ Code, npm will use <a href="https://github.com/nodejs/node-gyp">node-gyp</a> for that task. For a Unix system, <a href="https://github.com/nodejs/node-gyp">node-gyp</a> needs Python, make and a buildchain like GCC. On Windows, Python and Microsoft Visual Studio C++ are needed. For more information visit <a href="https://github.com/nodejs/node-gyp">the node-gyp repository</a> and the <a href="https://github.com/nodejs/node-gyp/wiki">node-gyp Wiki</a>.</p> <h3 id="directories">Directories</h3> <p>See <a href="../configuring-npm/folders.html"><code>folders</code></a> to learn about where npm puts stuff.</p> <p>In particular, npm has two modes of operation:</p> <ul> <li>global mode: npm installs packages into the install prefix at <code>prefix/lib/node_modules</code> and bins are installed in <code>prefix/bin</code>.</li> <li>local mode: npm installs packages into the current project directory, which defaults to the current working directory. Packages are installed to <code>./node_modules</code>, and bins are installed to <code>./node_modules/.bin</code>.</li> </ul> <p>Local mode is the default. Use <code>-g</code> or <code>--global</code> on any command to operate in global mode instead.</p> <h3 id="developer-usage">Developer Usage</h3> <p>If you’re using npm to develop and publish your code, check out the following help topics:</p> <ul> <li>json: Make a package.json file. See <a href="../configuring-npm/package-json.html"><code>package.json</code></a>.</li> <li>link: For linking your current working code into Node’s path, so that you don’t have to reinstall every time you make a change. Use <code>npm link</code> to do this.</li> <li>install: It’s a good idea to install things if you don’t need the symbolic link. Especially, installing other peoples code from the registry is done via <code>npm install</code></li> <li>adduser: Create an account or log in. Credentials are stored in the user config file.</li> <li>publish: Use the <code>npm publish</code> command to upload your code to the registry.</li> </ul> <h4 id="configuration">Configuration</h4> <p>npm is extremely configurable. It reads its configuration options from 5 places.</p> <ul> <li>Command line switches: Set a config with <code>--key val</code>. All keys take a value, even if they are booleans (the config parser doesn’t know what the options are at the time of parsing). If no value is provided, then the option is set to boolean <code>true</code>.</li> <li>Environment Variables: Set any config by prefixing the name in an environment variable with <code>npm_config_</code>. For example, <code>export npm_config_key=val</code>.</li> <li>User Configs: The file at $HOME/.npmrc is an ini-formatted list of configs. If present, it is parsed. If the <code>userconfig</code> option is set in the cli or env, then that will be used instead.</li> <li>Global Configs: The file found at ../etc/npmrc (from the node executable, by default this resolves to /usr/local/etc/npmrc) will be parsed if it is found. If the <code>globalconfig</code> option is set in the cli, env, or user config, then that file is parsed instead.</li> <li>Defaults: npm’s default configuration options are defined in lib/utils/config-defs.js. These must not be changed.</li> </ul> <p>See <a href="../using-npm/config.html"><code>config</code></a> for much much more information.</p> <h3 id="contributions">Contributions</h3> <p>Patches welcome!</p> <p>If you would like to contribute, but don’t know what to work on, read the contributing guidelines and check the issues list.</p> <ul> <li><a href="https://github.com/npm/cli/blob/latest/CONTRIBUTING.md">CONTRIBUTING.md</a></li> <li><a href="https://github.com/npm/cli/issues">Bug tracker</a></li> </ul> <h3 id="bugs">Bugs</h3> <p>When you find issues, please report them:</p> <ul> <li>web: <a href="https://npm.community/c/bugs">https://npm.community/c/bugs</a></li> </ul> <p>Be sure to follow the template and bug reporting guidelines. You can also ask for help in the <a href="https://npm.community/c/support">support forum</a> if you’re unsure if it’s actually a bug or are having trouble coming up with a detailed reproduction to report.</p> <h3 id="author">Author</h3> <p><a href="http://blog.izs.me/">Isaac Z. Schlueter</a> :: <a href="https://github.com/isaacs/">isaacs</a> :: <a href="https://twitter.com/izs">@izs</a> :: <a href="mailto:i@izs.me">i@izs.me</a></p> <h3 id="see-also">See Also</h3> <ul> <li><a href="../commands/npm-help.html">npm help</a></li> <li><a href="../configuring-npm/package-json.html">package.json</a></li> <li><a href="../commands/npm-install.html">npm install</a></li> <li><a href="../commands/npm-config.html">npm config</a></li> <li><a href="../configuring-npm/npmrc.html">npmrc</a></li> </ul> </div> <footer id="edit"> <a href="https://github.com/npm/cli/edit/v6/docs/content/commands/npm.md"> <svg role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentcolor" style="vertical-align: text-bottom; margin-right: 0.3em;"> <path fill-rule="evenodd" d="M11.013 1.427a1.75 1.75 0 012.474 0l1.086 1.086a1.75 1.75 0 010 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 01-.927-.928l.929-3.25a1.75 1.75 0 01.445-.758l8.61-8.61zm1.414 1.06a.25.25 0 00-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 000-.354l-1.086-1.086zM11.189 6.25L9.75 4.81l-6.286 6.287a.25.25 0 00-.064.108l-.558 1.953 1.953-.558a.249.249 0 00.108-.064l6.286-6.286z"></path> </svg> Edit this page on GitHub </a> </footer> </section> </body></html>