Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 849 Vote(s) - 3.55 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)

#11
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

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

You may also need to do:

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

Additionally, NVM modifies the PATH variable in `$HOME/.bashrc`, which must be [reverted manually][1].

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.


[1]:

[To see links please register here]

Reply

#12
First of all, you need to deactivate node: (mac) after install new node version.

nvm deactivate

This is removed /Users/user_name/.nvm/*/bin from $PATH

And after that node was updated

node --version
v10.9.0
Reply

#13
The best way is to download an installer package: .pkg on mac. Prefer the latest stable version.

Here is the link: [Node.js][1]

This package will eventually overwrite the previous version and set environment variables accordingly. Just run the installer and its done within a few clicks.


[1]:

[To see links please register here]

Reply

#14
Worked for me.

$node --version

v11.1.0

$nvm deactivate

$nvm uninstall v11.1.0
Reply

#15
After

brew uninstall node

I had to know which node

which node
then remove that

rm -rf /usr/local/bin/node
Reply

#16
If you have already installed [nvm](

[To see links please register here]

) then execute the following commands

- `nvm deactivate` - This will remove /.nvm/*/bin from $PATH
- `nvm list` - To list out all the versions of node installed in the system
- `nvm uninstall <version>` in <version> you can specify all the versions you want to uninstall.


It is always a good that you install node using `nvm` and uninstall using `nvm`
rather than `brew` .

This solution worked for me.

Additional Commands

- `which node` to know the path of node installed in your system. You can rm this directory to uninstall node manually. Then you may need to adjust the PATH file accordingly.


Reply

#17
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 4 commands in the terminal:

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

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

#18
In my case none of the other answers worked because I previously downgraded to node8. So instead of doing above, following worked for me:
```
which node
```
which returned `/usr/local/bin/node@8` instead of `/usr/local/bin/node`

so i executed this command:
```
brew uninstall node@8
```
which worked and then downloaded latest pkg from official site and installed. After that I had to close my terminal and start again to access new version
Reply

#19
As a companion to the answers explaining cleanup and install via homebrew, I found that homebrew itself provided clear indications of the symlink clashes.

Unfortunately it provides these one by one as it encounters them, so it is a little laborious, but it does seem to find all the clashes and was the only way I could get a clean install with homebrew.

Essentially, the process is:

1. use homebrew to uninstall node
2. clean homebrew
3. use homebrew to install node and note any flagged clashing file
4. delete the flag clashing file (or whole directory if it is a 'node' directory)
5. goto step 1 until you get a clean install

[![Diagrammatically][1]][1]:



Here is a screen output from the last steps of my install - you can see it results in a clean install (eventually...):

<!-- language: lang-sc -->

computer1:DevResources user1$ brew install node
Updating Homebrew...
==> Downloading

[To see links please register here]

Already downloaded: /Users/user1/Library/Caches/Homebrew/downloads/da904f1fdab6f6b2243a810b685e67b29a642c6e945f086e0022323a37fe85f9--node-13.1.0.mojave.bottle.tar.gz
==> Pouring node-13.1.0.mojave.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/systemtap/tapset/node.stp
Target /usr/local/share/systemtap/tapset/node.stp
already exists. You may want to remove it:
rm '/usr/local/share/systemtap/tapset/node.stp'

To force the link and overwrite all conflicting files:
brew link --overwrite node

To list all files that would be deleted:
brew link --overwrite --dry-run node

Possible conflicting files are:
/usr/local/share/systemtap/tapset/node.stp
/usr/local/lib/dtrace/node.d
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary
🍺 /usr/local/Cellar/node/13.1.0: 4,591 files, 54.2MB
computer1:DevResources user1$ rm '/usr/local/share/systemtap/tapset/node.stp'
computer1:DevResources user1$ brew uninstall node
Uninstalling /usr/local/Cellar/node/13.1.0... (4,591 files, 54.2MB)
computer1:DevResources user1$ brew cleanup
computer1:DevResources user1$ brew install node
Updating Homebrew...
==> Downloading

[To see links please register here]

Already downloaded: /Users/user1/Library/Caches/Homebrew/downloads/da904f1fdab6f6b2243a810b685e67b29a642c6e945f086e0022323a37fe85f9--node-13.1.0.mojave.bottle.tar.gz
==> Pouring node-13.1.0.mojave.bottle.tar.gz
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink lib/dtrace/node.d
Target /usr/local/lib/dtrace/node.d
already exists. You may want to remove it:
rm '/usr/local/lib/dtrace/node.d'

To force the link and overwrite all conflicting files:
brew link --overwrite node

To list all files that would be deleted:
brew link --overwrite --dry-run node

Possible conflicting files are:
/usr/local/lib/dtrace/node.d
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary
🍺 /usr/local/Cellar/node/13.1.0: 4,591 files, 54.2MB
computer1:DevResources user1$ rm '/usr/local/lib/dtrace/node.d'
computer1:DevResources user1$
computer1:DevResources user1$ brew uninstall node
Uninstalling /usr/local/Cellar/node/13.1.0... (4,591 files, 54.2MB)
computer1:DevResources user1$ brew cleanup
computer1:DevResources user1$ brew install node
Updating Homebrew...
==> Downloading

[To see links please register here]

Already downloaded: /Users/user1/Library/Caches/Homebrew/downloads/da904f1fdab6f6b2243a810b685e67b29a642c6e945f086e0022323a37fe85f9--node-13.1.0.mojave.bottle.tar.gz
==> Pouring node-13.1.0.mojave.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
/usr/local/etc/bash_completion.d
==> Summary
🍺 /usr/local/Cellar/node/13.1.0: 4,591 files, 54.2MB
computer1:DevResources user1$ node -v
v13.1.0


[1]:
Reply

#20
# **For brew users, OSX**:
To remove:

<!-- language: lang-bash -->

brew uninstall node;
# or `brew uninstall --force node` which removes all versions
brew cleanup;
rm -f /usr/local/bin/npm /usr/local/lib/dtrace/node.d;
rm -rf ~/.npm;

To install:

<!-- language: lang-bash -->

brew install node;
which node # => /usr/local/bin/node
export NODE_PATH='/usr/local/lib/node_modules' # <--- add this ~/.bashrc

You can run `brew info node` for more details regarding your node installs.

_________

# consider using NVM instead of brew

NVM (node version manager) is a portable solution for managing multiple versions of node

##

[To see links please register here]



> nvm uninstall v4.1.0
> nvm install v8.1.2
> nvm use v8.1.2
> nvm list
v4.2.0
v5.8.0
v6.11.0
-> v8.1.2
system

[you can use this with AVN][1] to automatically switch versions as you hop between different projects with different node dependencies.


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through