e41c732356fee59946bd21c002af3bc054e9a02b
[platform/upstream/nodejs.git] / deps / npm / html / doc / misc / removing-npm.html
1 <!doctype html>
2 <html>
3   <title>removing-npm</title>
4   <meta http-equiv="content-type" value="text/html;utf-8">
5   <link rel="stylesheet" type="text/css" href="../../static/style.css">
6
7   <body>
8     <div id="wrapper">
9 <h1><a href="../cli/npm-removal.html">npm-removal</a></h1> <p>Cleaning the Slate</p>
10
11 <h2 id="SYNOPSIS">SYNOPSIS</h2>
12
13 <p>So sad to see you go.</p>
14
15 <pre><code>sudo npm uninstall npm -g</code></pre>
16
17 <p>Or, if that fails, get the npm source code, and do:</p>
18
19 <pre><code>sudo make uninstall</code></pre>
20
21 <h2 id="More-Severe-Uninstalling">More Severe Uninstalling</h2>
22
23 <p>Usually, the above instructions are sufficient.  That will remove
24 npm, but leave behind anything you&#39;ve installed.</p>
25
26 <p>If that doesn&#39;t work, or if you require more drastic measures,
27 continue reading.</p>
28
29 <p>Note that this is only necessary for globally-installed packages.  Local
30 installs are completely contained within a project&#39;s <code>node_modules</code>
31 folder.  Delete that folder, and everything is gone (unless a package&#39;s
32 install script is particularly ill-behaved).</p>
33
34 <p>This assumes that you installed node and npm in the default place.  If
35 you configured node with a different <code>--prefix</code>, or installed npm with a
36 different prefix setting, then adjust the paths accordingly, replacing
37 <code>/usr/local</code> with your install prefix.</p>
38
39 <p>To remove everything npm-related manually:</p>
40
41 <pre><code>rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*</code></pre>
42
43 <p>If you installed things <em>with</em> npm, then your best bet is to uninstall
44 them with npm first, and then install them again once you have a
45 proper install.  This can help find any symlinks that are lying
46 around:</p>
47
48 <pre><code>ls -laF /usr/local/{lib/node{,/.npm},bin,share/man} | grep npm</code></pre>
49
50 <p>Prior to version 0.3, npm used shim files for executables and node
51 modules.  To track those down, you can do the following:</p>
52
53 <pre><code>find /usr/local/{lib/node,bin} -exec grep -l npm \{\} \; ;</code></pre>
54
55 <p>(This is also in the <a href="../../doc/README.html">README</a> file.)</p>
56
57 <h2 id="SEE-ALSO">SEE ALSO</h2>
58
59 <ul><li><a href="../../doc/README.html">README</a></li><li><a href="../cli/npm-rm.html">npm-rm(1)</a></li><li><a href="../cli/npm-prune.html">npm-prune(1)</a></li></ul>
60 </div>
61 <p id="footer">removing-npm &mdash; npm@1.3.15</p>
62 <script>
63 ;(function () {
64 var wrapper = document.getElementById("wrapper")
65 var els = Array.prototype.slice.call(wrapper.getElementsByTagName("*"), 0)
66   .filter(function (el) {
67     return el.parentNode === wrapper
68         && el.tagName.match(/H[1-6]/)
69         && el.id
70   })
71 var l = 2
72   , toc = document.createElement("ul")
73 toc.innerHTML = els.map(function (el) {
74   var i = el.tagName.charAt(1)
75     , out = ""
76   while (i > l) {
77     out += "<ul>"
78     l ++
79   }
80   while (i < l) {
81     out += "</ul>"
82     l --
83   }
84   out += "<li><a href='#" + el.id + "'>" +
85     ( el.innerText || el.text || el.innerHTML)
86     + "</a>"
87   return out
88 }).join("\n")
89 toc.id = "toc"
90 document.body.appendChild(toc)
91 })()
92 </script>