Arquivo da categoria: Controle de Dependência

Gradle plugin for deploying WARs to AWS Elastic Beanstalk.

How to Uninstall Node.js from Mac OSX


If you installed Node either by source or from a binary distribution then you’ll likely have to delete the executable and other resources manually. Unfortunately, this isn’t easy since there are quite a few directories containing Node resources, like npm and node_modules.

To completely uninstall the node executable as well as npm, here are some instructions on what to do:

Note that not all of the directories listed here may exist on your system depending on your install method.

  • Delete node and/or node_modules from /usr/local/lib
  • Delete node and/or node_modules from /usr/local/include
  • Delete nodenode-debug, and node-gyp from /usr/local/bin
  • Delete .npmrc from your home directory (these are your npm settings, don’t delete this if you plan on re-installing Node right away)
  • Delete .npm from your home directory
  • Delete .node-gyp from your home directory
  • Delete .node_repl_history from your home directory
  • Delete node* from /usr/local/share/man/man1/
  • Delete npm* from /usr/local/share/man/man1/
  • Delete node.d from /usr/local/lib/dtrace/
  • Delete node from /opt/local/bin/
  • Delete node from /opt/local/include/
  • Delete node_modules from /opt/local/lib/
  • Delete node from /usr/local/share/doc/
  • Delete node.stp from /usr/local/share/systemtap/tapset/

This list should include just about all the references to Node on your system. Keep in mind there may be more. Please let me know if you find any others (and how you installed Node originally)!


The Homebrew method is arguably one of the easiest ways to get Node on and off your system. The command to remove it is just as simple as the command to install it. Assuming you used brew install node to install it, just execute this to get rid of it:

<code class="language-sh hljs bash">$ brew uninstall node

And that’s it! All traces of the executable will be gone from your system.


The Node Version Manager (NVM) is almost as convenient as Homebrew, but in a different way. It allows you to install multiple versions of Node on your system so you can easily switch from one to the other.

Eventually, you’ll probably want to get rid of one of the versions when you’re done with it. And like Homebrew, you can easily do this using a command similar to the way you installed it:

<code class="language-sh hljs bash">$ nvm uninstall &lt;version&gt;

And a complete example of this might be something like:

<code class="language-sh hljs bash">$ nvm uninstall v0.<span class="hljs-number">12.2</span>

And now only version v0.12.2 of Node will be uninstalled. Keep in mind that if you had multiple versions installed, then Node will still be on your system, but not v0.12.2 (using the example above).

Phantom Installs

If for some reason none of the above methods worked for you, then you can always hunt down the executable using the command line tool which. This command shows you the location of the file for a given command.

We can use this to find where Node is installed on your system. You can try this with:

<code class="language-sh hljs bash">$ <span class="hljs-built_in">which</span> node
/Users/scott/.nvm/versions/node/v4.<span class="hljs-number">1.2</span>/bin/node

You can see in the output that my node command is linked to an NVM version, although yours may be located somewhere else. Now I can use this info to uninstall it.

Using this tool should help you find out how the executable was installed or how to remove it manually.


Creating Packages


Packages are defined by a manifest file bower.json. This is similar to Node’s package.json or Ruby’s Gemfile.

Interactively create a bower.json with bower init

<code class="language-bash" data-lang="bash"><span class="gp">$ </span>bower init</code>


Detailed specification of bower.json file can be found in bower/spec repository.

Maintaining dependencies

Using bower install <package> --save will add <package> to your project’s bower.json dependencies array.

<code class="language-bash" data-lang="bash"><span class="c"># install package and add it to bower.json dependencies</span>
<span class="gp">$ </span>bower install &lt;package&gt; --save</code>

Similarly, using bower install <package> --save-dev will add <package> to your project’s bower.json devDependencies array.

<code class="language-bash" data-lang="bash"><span class="c"># install package and add it to bower.json devDependencies</span>
<span class="gp">$ </span>bower install &lt;package&gt; --save-dev</code>


Registering your package allows others to install it with a short name, like bower install <my-package-name>.

To register a new package:

  • The package name must adhere to the bower.json spec.
  • There must be a valid bower.json in the project’s root directory.
  • Your package should use semver Git tags. The v prefix is allowed.
  • Your package must be publically available at a Git endpoint (e.g., GitHub). Remember to push your Git tags!
  • For private packages (e.g. GitHub Enterprise), please consider running a private Bower registry.

Then use bower register:

<code class="language-bash" data-lang="bash"><span class="gp">$ </span>bower register &lt;my-package-name&gt; &lt;git-endpoint&gt;
<span class="c"># for example</span>
<span class="gp">$ </span>bower register example git://</code>

Now anyone can run bower install <my-package-name>, and get your library installed. The Bower registry does not have authentication or user management at this point in time. It’s on a first come, first served basis.

Bower doesn’t support GitHub-style namespacing (org/repo), however you are encouraged to namespace related packages with -, for example, angular- and paper-.

Please do not squat on package names. Register your package and claim your name after you have a valid public repo with working code.

For package name transfers, intellectual property and other disputes, please try to resolve with the owner first. If no resolution, please submit a ticket in the Bower Registry repo and the Bower Core Team will assist.


You can unregister packages with bower unregister. You first need to authenticate with GitHub with bower login to confirm you are a contributor to the package repo.

<code class="language-bash" data-lang="bash">bower login
<span class="c"># enter username and password</span>
? Username:
? Password:
<span class="c"># unregister packages after successful login</span>
bower unregister &lt;package&gt;</code>

You’ll likely want to bower cache clean after your change. Please remember it is generally considered bad behavior to remove versions of a library that others are depending on. Think twice 🙂 If the above doesn’t work for you, you can request a package be unregistered manually.