PageRenderTime 45ms CodeModel.GetById 14ms RepoModel.GetById 1ms app.codeStats 0ms

/deps/npm/html/doc/README.html

https://bitbucket.org/wwag110465/node
HTML | 275 lines | 192 code | 83 blank | 0 comment | 0 complexity | 57683fecebc3481cc0391a099acae2e1 MD5 | raw file
  1. <!doctype html>
  2. <html>
  3. <title>README</title>
  4. <meta http-equiv="content-type" value="text/html;utf-8">
  5. <link rel="stylesheet" type="text/css" href="../static/style.css">
  6. <body>
  7. <div id="wrapper">
  8. <h1><a href="../doc/npm.html">npm</a></h1> <p>node package manager</p>
  9. <h2 id="SYNOPSIS">SYNOPSIS</h2>
  10. <p>This is just enough info to get you up and running.</p>
  11. <p>Much more info available via <code>npm help</code> once it&#39;s installed.</p>
  12. <h2 id="IMPORTANT">IMPORTANT</h2>
  13. <p><strong>You need node v0.6 or higher to run this program.</strong></p>
  14. <p>To install an old <strong>and unsupported</strong> version of npm that works on node 0.3
  15. and prior, clone the git repo and dig through the old tags and branches.</p>
  16. <h2 id="Super-Easy-Install">Super Easy Install</h2>
  17. <p>npm comes with node now.</p>
  18. <h3 id="Windows-Computers">Windows Computers</h3>
  19. <p>Get the MSI. npm is in it.</p>
  20. <h3 id="Apple-Macintosh-Computers">Apple Macintosh Computers</h3>
  21. <p>Get the pkg. npm is in it.</p>
  22. <h3 id="Other-Sorts-of-Unices">Other Sorts of Unices</h3>
  23. <p>Run <code>make install</code>. npm will be installed with node.</p>
  24. <p>If you want a more fancy pants install (a different version, customized
  25. paths, etc.) then read on.</p>
  26. <h2 id="Fancy-Install-Unix">Fancy Install (Unix)</h2>
  27. <p>There&#39;s a pretty robust install script at
  28. <a href="https://npmjs.org/install.sh">https://npmjs.org/install.sh</a>. You can download that and run it.</p>
  29. <h3 id="Slightly-Fancier">Slightly Fancier</h3>
  30. <p>You can set any npm configuration params with that script:</p>
  31. <pre><code>npm_config_prefix=/some/path sh install.sh</code></pre>
  32. <p>Or, you can run it in uber-debuggery mode:</p>
  33. <pre><code>npm_debug=1 sh install.sh</code></pre>
  34. <h3 id="Even-Fancier">Even Fancier</h3>
  35. <p>Get the code with git. Use <code>make</code> to build the docs and do other stuff.
  36. If you plan on hacking on npm, <code>make link</code> is your friend.</p>
  37. <p>If you&#39;ve got the npm source code, you can also semi-permanently set
  38. arbitrary config keys using the <code>./configure --key=val ...</code>, and then
  39. run npm commands by doing <code>node cli.js &lt;cmd&gt; &lt;args&gt;</code>. (This is helpful
  40. for testing, or running stuff without actually installing npm itself.)</p>
  41. <h2 id="Fancy-Windows-Install">Fancy Windows Install</h2>
  42. <p>You can download a zip file from <a href="https://npmjs.org/dist/">https://npmjs.org/dist/</a>, and unpack it
  43. in the same folder where node.exe lives.</p>
  44. <p>If that&#39;s not fancy enough for you, then you can fetch the code with
  45. git, and mess with it directly.</p>
  46. <h2 id="Installing-on-Cygwin">Installing on Cygwin</h2>
  47. <p>No.</p>
  48. <h2 id="Permissions-when-Using-npm-to-Install-Other-Stuff">Permissions when Using npm to Install Other Stuff</h2>
  49. <p><strong>tl;dr</strong></p>
  50. <ul><li>Use <code>sudo</code> for greater safety. Or don&#39;t, if you prefer not to.</li><li>npm will downgrade permissions if it&#39;s root before running any build
  51. scripts that package authors specified.</li></ul>
  52. <h3 id="More-details">More details...</h3>
  53. <p>As of version 0.3, it is recommended to run npm as root.
  54. This allows npm to change the user identifier to the <code>nobody</code> user prior
  55. to running any package build or test commands.</p>
  56. <p>If you are not the root user, or if you are on a platform that does not
  57. support uid switching, then npm will not attempt to change the userid.</p>
  58. <p>If you would like to ensure that npm <strong>always</strong> runs scripts as the
  59. &quot;nobody&quot; user, and have it fail if it cannot downgrade permissions, then
  60. set the following configuration param:</p>
  61. <pre><code>npm config set unsafe-perm false</code></pre>
  62. <p>This will prevent running in unsafe mode, even as non-root users.</p>
  63. <h2 id="Uninstalling">Uninstalling</h2>
  64. <p>So sad to see you go.</p>
  65. <pre><code>sudo npm uninstall npm -g</code></pre>
  66. <p>Or, if that fails,</p>
  67. <pre><code>sudo make uninstall</code></pre>
  68. <h2 id="More-Severe-Uninstalling">More Severe Uninstalling</h2>
  69. <p>Usually, the above instructions are sufficient. That will remove
  70. npm, but leave behind anything you&#39;ve installed.</p>
  71. <p>If you would like to remove all the packages that you have installed,
  72. then you can use the <code>npm ls</code> command to find them, and then <code>npm rm</code> to
  73. remove them.</p>
  74. <p>To remove cruft left behind by npm 0.x, you can use the included
  75. <code>clean-old.sh</code> script file. You can run it conveniently like this:</p>
  76. <pre><code>npm explore npm -g -- sh scripts/clean-old.sh</code></pre>
  77. <p>npm uses two configuration files, one for per-user configs, and another
  78. for global (every-user) configs. You can view them by doing:</p>
  79. <pre><code>npm config get userconfig # defaults to ~/.npmrc
  80. npm config get globalconfig # defaults to /usr/local/etc/npmrc</code></pre>
  81. <p>Uninstalling npm does not remove configuration files by default. You
  82. must remove them yourself manually if you want them gone. Note that
  83. this means that future npm installs will not remember the settings that
  84. you have chosen.</p>
  85. <h2 id="Using-npm-Programmatically">Using npm Programmatically</h2>
  86. <p>If you would like to use npm programmatically, you can do that.
  87. It&#39;s not very well documented, but it <em>is</em> rather simple.</p>
  88. <p>Most of the time, unless you actually want to do all the things that
  89. npm does, you should try using one of npm&#39;s dependencies rather than
  90. using npm itself, if possible.</p>
  91. <p>Eventually, npm will be just a thin cli wrapper around the modules
  92. that it depends on, but for now, there are some things that you must
  93. use npm itself to do.</p>
  94. <pre><code>var npm = require(&quot;npm&quot;)
  95. npm.load(myConfigObject, function (er) {
  96. if (er) return handlError(er)
  97. npm.commands.install([&quot;some&quot;, &quot;args&quot;], function (er, data) {
  98. if (er) return commandFailed(er)
  99. // command succeeded, and data might have some info
  100. })
  101. npm.on(&quot;log&quot;, function (message) { .... })
  102. })</code></pre>
  103. <p>The <code>load</code> function takes an object hash of the command-line configs.
  104. The various <code>npm.commands.&lt;cmd&gt;</code> functions take an <strong>array</strong> of
  105. positional argument <strong>strings</strong>. The last argument to any
  106. <code>npm.commands.&lt;cmd&gt;</code> function is a callback. Some commands take other
  107. optional arguments. Read the source.</p>
  108. <p>You cannot set configs individually for any single npm function at this
  109. time. Since <code>npm</code> is a singleton, any call to <code>npm.config.set</code> will
  110. change the value for <em>all</em> npm commands in that process.</p>
  111. <p>See <code>./bin/npm-cli.js</code> for an example of pulling config values off of the
  112. command line arguments using nopt. You may also want to check out <code>npm
  113. help config</code> to learn about all the options you can set there.</p>
  114. <h2 id="More-Docs">More Docs</h2>
  115. <p>Check out the <a href="https://npmjs.org/doc/">docs</a>,
  116. especially the <a href="https://npmjs.org/doc/faq.html">faq</a>.</p>
  117. <p>You can use the <code>npm help</code> command to read any of them.</p>
  118. <p>If you&#39;re a developer, and you want to use npm to publish your program,
  119. you should <a href="https://npmjs.org/doc/developers.html">read this</a></p>
  120. <h2 id="Legal-Stuff">Legal Stuff</h2>
  121. <p>&quot;npm&quot; and &quot;the npm registry&quot; are owned by Isaac Z. Schlueter. All
  122. rights not explicitly granted in the MIT license are reserved. See the
  123. included LICENSE file for more details.</p>
  124. <p>&quot;Node.js&quot; and &quot;node&quot; are trademarks owned by Joyent, Inc. npm is not
  125. officially part of the Node.js project, and is neither owned by nor
  126. officially affiliated with Joyent, Inc.</p>
  127. <p>The packages in the npm registry are not part of npm itself, and are the
  128. sole property of their respective maintainers. While every effort is
  129. made to ensure accountability, there is absolutely no guarantee,
  130. warrantee, or assertion made as to the quality, fitness for a specific
  131. purpose, or lack of malice in any given npm package. Modules
  132. published on the npm registry are not affiliated with or endorsed by
  133. Joyent, Inc., Isaac Z. Schlueter, Ryan Dahl, or the Node.js project.</p>
  134. <p>If you have a complaint about a package in the npm registry, and cannot
  135. resolve it with the package owner, please express your concerns to
  136. Isaac Z. Schlueter at <a href="mailto:i@izs.me">i@izs.me</a>.</p>
  137. <h3 id="In-plain-english">In plain english</h3>
  138. <p>This is mine; not my employer&#39;s, not Node&#39;s, not Joyent&#39;s, not Ryan
  139. Dahl&#39;s.</p>
  140. <p>If you publish something, it&#39;s yours, and you are solely accountable
  141. for it. Not me, not Node, not Joyent, not Ryan Dahl.</p>
  142. <p>If other people publish something, it&#39;s theirs. Not mine, not Node&#39;s,
  143. not Joyent&#39;s, not Ryan Dahl&#39;s.</p>
  144. <p>Yes, you can publish something evil. It will be removed promptly if
  145. reported, and we&#39;ll lose respect for you. But there is no vetting
  146. process for published modules.</p>
  147. <p>If this concerns you, inspect the source before using packages.</p>
  148. <h2 id="BUGS">BUGS</h2>
  149. <p>When you find issues, please report them:</p>
  150. <ul><li>web:
  151. <a href="https://github.com/isaacs/npm/issues">https://github.com/isaacs/npm/issues</a></li><li>email:
  152. <a href="mailto:npm-@googlegroups.com">npm-@googlegroups.com</a></li></ul>
  153. <p>Be sure to include <em>all</em> of the output from the npm command that didn&#39;t work
  154. as expected. The <code>npm-debug.log</code> file is also helpful to provide.</p>
  155. <p>You can also look for isaacs in #node.js on irc://irc.freenode.net. He
  156. will no doubt tell you to put the output in a gist or email.</p>
  157. <h2 id="SEE-ALSO">SEE ALSO</h2>
  158. <ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/help.html">help(1)</a></li><li><a href="../doc/index.html">index(1)</a></li></ul>
  159. </div>
  160. <p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@1.2.14</p>
  161. <script>
  162. ;(function () {
  163. var wrapper = document.getElementById("wrapper")
  164. var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
  165. .filter(function (el) {
  166. return el.parentNode === wrapper
  167. && el.tagName.match(/H[1-6]/)
  168. && el.id
  169. })
  170. var l = 2
  171. , toc = document.createElement("ul")
  172. toc.innerHTML = els.map(function (el) {
  173. var i = el.tagName.charAt(1)
  174. , out = ""
  175. while (i > l) {
  176. out += "<ul>"
  177. l ++
  178. }
  179. while (i < l) {
  180. out += "</ul>"
  181. l --
  182. }
  183. out += "<li><a href='#" + el.id + "'>" +
  184. ( el.innerText || el.text || el.innerHTML)
  185. + "</a>"
  186. return out
  187. }).join("\n")
  188. toc.id = "toc"
  189. document.body.appendChild(toc)
  190. })()
  191. </script>
  192. </body></html>