Blog coding and discussion of coding about JavaScript, PHP, CGI, general web building etc.

Monday, May 9, 2016

How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)

How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


My version of node is always v0.6.1-pre even after I install brew node and NVM install v0.6.19.

My node version is:

node -v  v0.6.1-pre  

NVM says this (after I install a version of node for the first time in one bash terminal):

nvm ls  v0.6.19  current:    v0.6.19  

But when I restart bash, this is what I see:

nvm ls  v0.6.19  current:    v0.6.1-pre  default -> 0.6.19 (-> v0.6.19)  

So where is this phantom node 0.6.1-pre version and how can I get rid of it? I'm trying to install libraries via NPM so that I can work on a project.

I tried using BREW to update before NVM, using "brew update" and "brew install node". I've tried deleting the "node" directory in my /usr/local/include and the "node" and "node_modules" in my "/usr/local/lib". I've tried uninstalling npm and reinstalling it following these instructions.

All of this because I was trying to update an older version of node to install the "zipstream" library. Now there's folders in my users directory, and the node version STILL isn't up to date, even though NVM says it's using 0.6.19.

Ideally, I'd like to uninstall nodejs, npm, and nvm, and just reinstall the entire thing from scratch on my system.

Answer by Dominic Tancredi for How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


Apparently, there was a /Users/myusername/local folder that contained a include with node and lib with node and node_modules. How and why this was created instead of in my /usr/local folder, I do not know.

Deleting these local references fixed the phantom v0.6.1-pre. If anyone has an explanation, I'll choose that as the correct answer.

EDIT:

You may need to do the additional instructions as well:

sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}  

which is the equivalent of (same as above)...

sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* /usr/local/lib/dtrace/node.d ~/.npm ~/.node-gyp /opt/local/bin/node opt/local/include/node /opt/local/lib/node_modules  

or (same as above) broken down...

To completely uninstall node + npm is to do the following:

  1. go to /usr/local/lib and delete any node and node_modules
  2. go to /usr/local/include and delete any node and node_modules directory
  3. if you installed with brew install node, then run brew uninstall node in your terminal
  4. check your Home directory for any local or lib or include folders, and delete any node or node_modules from there
  5. go to /usr/local/bin and delete any node executable

Then download nvm and follow the instructions to install node. The latest versions of node come with npm, I believe, but you can also reinstall that as well.

Answer by toutpt for How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


I have been hit by an issue during uninstall of Node.js on my mac. I had some strange behavior like npm is still their even after having removing it with all this.

It was because I had an old install done with macport. So you also have to uninstall it using port:

sudo port uninstall nodejs  

It may have install many different versions of Node.js so uninstall them all (one by one).

Answer by Pedro Polonia for How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


On Mavericks I install it from the node pkg (from nodejs site) and I uninstall it so I can re-install using brew. I only run 3 commands in the terminal:

  1. sudo rm -rf /usr/local/lib/node_modules/npm/
  2. brew uninstall node
  3. brew doctor
  4. brew prune

If there is still a node installation, repeat step 2. After all is ok, I install using brew install node

Answer by John for How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


I'm not sure about the Mac OS installer, but I've found that the NodeJS .msi installer for Windows has an option to uninstall Node. I did that and it worked perfectly.

Answer by DaveyJake for How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


I know this post is a little dated but just wanted to share the commands that worked for me in Terminal when removing Node.js

lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do  sudo rm /usr/local/${f}; done    sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*  

Answer by swipe for How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


maybe you need to make

hash -r   

it helps with problem of symlink

$ node -v  $ bash: /opt/local/bin/node: No such file or directory  

Answer by lfender6445 for How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


For brew users, OSX:

brew uninstall node;  brew prune;  rm -f /usr/local/bin/npm;  rm -f /usr/local/lib/dtrace/node.d;  rm -rf ~/.npm;  

then

brew install node;  which node #=> /usr/local/bin/node  export NODE_PATH='/usr/local/lib/node_modules' # add to bashrc if not already there  

Answer by Carlos Pérez Priego for How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


Additional to the main answer I needed to remove all npm instances found in:

rm -rf /usr/local/share/man/man1/npm*  

Answer by pcatre for How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


This fixed it for me Fixing npm On Mac OS X for Homebrew Users. And it does not require too many steps.

Just go to the solution part if you don't care about the why.

Answer by brockangelo for How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


Expanding on Dominic Tancredi's awesome answer, I've rolled this into a bash package and stand-alone script. If you are already using the "Back Package Manager" called bpkg you can install the script by running:

bpkg install -g brock/node-reinstall  

Or you can have a look at the script on Github at brock/node-reinstall. The script allows you to re-install node using nvm or nave, and to specify a node version as your default.

Answer by miukki for How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


downgrade node to 0.10.36

  sudo npm cache clean -f    sudo npm install -g n    sudo n 0.10.36  

upgrade node to stable v

  sudo npm cache clean -f    sudo npm install -g n    sudo n stable  

Answer by Johel Alvarez for How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


  1. First:

    lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do  sudo rm /usr/local/${f}; done    sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*  
  2. To recap, the best way (I've found) to completely uninstall node + npm is to do the following:

    go to /usr/local/lib and delete any node and node_modules

    cd /usr/local/lib    sudo rm -rf node*  
  3. go to /usr/local/include and delete any node and node_modules directory

    cd /usr/local/include    sudo rm -rf node*  
  4. if you installed with brew install node, then run brew uninstall node in your terminal

    brew uninstall node  
  5. check your Home directory for any "local" or "lib" or "include" folders, and delete any "node" or "node_modules" from there

    go to /usr/local/bin and delete any node executable

    cd /usr/local/bin    sudo rm -rf /usr/local/bin/npm    ls -las  
  6. You may need to do the additional instructions as well:

    sudo rm -rf /usr/local/share/man/man1/node.1    sudo rm -rf /usr/local/lib/dtrace/node.d    sudo rm -rf ~/.npm  

Source: tonyMtz

Answer by Dave Kuhlman for How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


I had installed Node.js from source downloaded from the git repository. I installed with:

./configure  $ make  $ sudo make install  

Because the make file supports it, I can do:

$ sudo make uninstall  

Answer by Pankaj katiyar for How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


In Ubuntu it work fine .......

$ sudo apt-get remove nodejs  

uninstall nodejs and npm and clean your directory

Removing node-delayed-stream (0.0.5-1) ...  Removing node-forever-agent (0.5.1-1) ...  Removing node-fstream-ignore (0.0.6-2) ...  Removing node-fstream (0.1.24-1) ...  Removing node-read-package-json (1.1.3-1) ...  Removing node-normalize-package-data (0.2.2-1) ...  Removing node-github-url-from-git (1.1.1-1) ...  Removing node-glob (3.2.6-1) ...  Removing node-graceful-fs (2.0.0-2) ...  Removing node-inherits (2.0.0-1) ...  Removing node-ini (1.1.0-1) ...  Removing node-json-stringify-safe (5.0.0-1) ...  Removing node-lockfile (0.4.1-1) ...  Removing node-minimatch (0.2.12-1) ...  Removing node-lru-cache (2.3.1-1) ...  Removing node-mime (1.2.11-1) ...  Removing node-mkdirp (0.3.5-1) ...  Removing node-read (1.0.4-1) ...  Removing node-mute-stream (0.0.3-1) ...  Removing node-node-uuid (1.4.0-1) ...  Removing node-once (1.1.1-1) ...  Removing node-osenv (0.0.3-1) ...  Removing node-qs (0.6.5-1) ...  Removing node-retry (0.6.0-1) ...  Removing node-rimraf (2.2.2-2) ...  Removing node-semver (2.1.0-2) ...  Removing node-sha (1.2.3-1) ...  Removing node-sigmund (1.0.0-1) ...  Removing node-slide (1.1.4-1) ...  Removing node-tunnel-agent (0.3.1-1) ...  Removing node-which (1.0.5-2) ...  Removing nodejs-dev (0.10.25~dfsg2-2ubuntu1) ...  Removing nodejs (0.10.25~dfsg2-2ubuntu1) ...  Processing triggers for doc-base (0.10.5) ...  Processing 5 removed doc-base files...  Processing triggers for man-db (2.6.7.1-1ubuntu1) ...  

Answer by aze for How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)


(server: ubuntu 14)

1.) install nvm (node version manager) https://github.com/creationix/nvm

2.) nvm install node

3.) npm -v (inquire npm version => 3.8.6)

4.) node -v (inquire node version => v6.0.0)


Fatal error: Call to a member function getElementsByTagName() on a non-object in D:\XAMPP INSTALLASTION\xampp\htdocs\endunpratama9i\www-stackoverflow-info-proses.php on line 72

0 comments:

Post a Comment

Popular Posts

Powered by Blogger.