cannot uninstall node and npm completely on high sierra - node.js

I recently installed Node on my MacBook running High Sierra 10.13 using the .pkg file supplied on their website.
After a few hours of experimenting with installing other packages and writing scripts, I decided I would like to uninstall both Node and NPM to get a fresh start.
I tried all of the top answers from this thread, but to my dismay, after having followed all instructions, and repeated all steps many times, terminal would still recognise the Node and NPM versions.
I ended up running a bash script through terminal which I found on the same thread, which ended up doing nothing but downgrading my current version of Node to 0.10.8 - making it a lot more difficult to delete in the long run.
I've re-done all of the steps from the aforementioned thread with no avail, and terminal still stating that it has version 0.10.8 (and NPM just completely not working at all)
Currently at my last stance of what to do, so hopefully someone on here can help me with my problem.
Cheers.

After searching through Google and StackOverflow for hours, I finally came up with a solution to the problem on my own.
Running the type command within terminal against node, I got this returned:
:~ myusername$ type node
node is /Users/myusername/.nvm/v0.10.48/bin/node
Subsequently, after deleting that folder, Node appears to be completely removed from my system.
I have since made sure that I have deleted all node and node_module folders that I could find within /usr/ to make sure - and I would suggest that anyone attempting this also do the same.

Try to run the following command
brew uninstall node
After the above command, you need to scan manually for node_modules if exists. Try following.
grep -irl "node_modules/node"
sudo rm -rf result_from_above_command
rm -rf ~/.npm
I hope this will remove all the node and it's components. As I have done like this, once before.
Thank you.

Related

Node & M1 Mac: dyld[]: missing symbol called

i really need your help.
I am having problems with node (v16.8.0) and my macOS with arm processor. Every time i want to run the backend of this project i get this:
dyld[17378]: missing symbol called
I have already followed the whole discussion on this other post.
I tried to do a clean install of node for arm with rosetta2, but if I run node -p "process.arch" I always get x64.
I've also tried with a more aggressive approach:
Removed all Node files, everything, in all folders and subfolder making sure that node was completely uninstalled
Removed the libraries and removed the dependencies
Re-installed Node with brew (using arch)
Re-installed libraries and dependencies
Since I have already removed and reinstalled node 5 times just today, could you please help me to find out how can I solve this problem? Thank you!
Once again, found the solution.
The solution was:
Clean up again everything. This means uninstall and delete all files for: yarn, npm, nvm, and node
Re-install everything via homebrew
Delete all node_modules
Re-run yarn/npm install in the repo

LESS instalation - node file does not exist on Linux

I'm trying to install LESS css in Netbeans, but I'm running into one problem after another. As such, I already have LESS installed, but I can't get it running.
Less is installed via the npm package, I installed it using the packaging system, less itself via Terminal. The first problem I had was that despite a successful installation, Netbeans didn't get to the files he needed (usr/local/), I could either change permissions there, which I don't want to dig into, or change the location. So I changed the location of the .npm and .npm-global folders to my root (home/ivet/), from where Netbeans managed to load it.
So I set everything there, the general settings and the specific project and it looked fine.
I want it to be converted to css automatically after saving, but it throws the message "/usr/bin/env:"node": Directory or file does not exist" and the target css file is still empty.
I found a few advices, basically the same: "ln -s /usr/bin/node/ usr/local/bin/nodejs", but it tells me that the link already exists and nothing will solve it. On closer inspection, I found that the link does exist, but the target file does not exist.
I've also found that installing Nodejs legacy solves this, but this is an older piece of advice, the package no longer exists, and terminal pretends to have the packages that replace this installed. Even when searching for via grep, I couldn't find the file it should link to (neither node nor nodejs).
There are the same tips everywhere that don't work for me and I don't know what to try next. I use Linux Mint 20, but I call myself a Linux BFU, so please write answer step by step :-D
Thanks for the advice
Try completely removing NodeJS & npm and try to install NodeJS using nvm i.e., node version manager.
You can follow this link on how to install nodejs and npm using nvm.
It's always a tedious task sometimes when it comes to package managment with npm, so it's better to go with nvm and I strongly suggest to always have a fallback option for node version when using with or without nvm i.e.,
NodeJS LTS version & NodeJS latest/stable version.
There's also an alternative solution i.e.,you can try switching to yarn package manager.
I've had this issue on Ubuntu and I've resolved it likes this:
First of all I've removed node and npm packages via
sudo aptitude remove node npm
Then I've added the official repositories
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
After which I've just updated the list of packages with sudo aptitude update and then installed Node
sudo aptitude install nodejs npm
And that was it. With these steps done, everything just started to work.

Nvm and Node keep going missing upon closing terminal

Hoping you can help me figure out this issue!
I just bought a new MacBook and was getting my development environment set up today. I installed XCode, Brew, NVM, and Git. When I installed Git, I had to change it so it was the first in the path so I could avoid using Apple Git, and I think that severely messed things up.
For some reason, nvm was not showing when I was running:
nvm ls or nvm ls-remote
Yet when I told brew to install nvm, it said it was already installed. OK. Eventually was able to get it sorted out and install node and such.
Fast forward to now, I went to run node in the terminal. Node was not found. Did some research and found that I should not install nvm with homebrew, so I did brew uninstall nvm and brew cleanup and then installed through the recommend github repository.
I ran the necessary commands and added to my PATH, and when I ran command -v nvm, nvm was returned. GREAT. Then I ran the other commands to install Node and I was able to use it, until I closed the terminal.
Now when I reopen the terminal and run node, it returns command not found. Command -v nvm does not return anything too.
Please help - it's been such a headache and I can't seem to figure out whats going on. Every solution I'm finding on Stack Overflow works until I close the terminal.
I was able to figure it out. The command all NVM guides tell you to run in order to start running node was not properly added to .bashrc.
Use these as a reference if you have the same issue as me:
https://itnext.io/nvm-the-easiest-way-to-switch-node-js-environments-on-your-machine-in-a-flash-17babb7d5f1b
.bashrc: Permission denied

Sublime text cannot find Node.js. How do I help Sublime find Node properly?

The story:
I had installed n about a month back while playing around with creating an Eslint config on my Mac, which was when Sublime Text started giving me problems, specifically with Eslint via Sublime linter. I had a bit of a break so I didn't attempt to fix the issue until last week, which was when I uninstalled n and installed nvm thinking that the issue was n. I then started getting the cannot find node error when I save any file in Sublime. Since then I had uninstalled nvm and node.js in hopes to start from scratch and fix the issue. I re-installed nvm and found this post, stating the issues that nvm creates with changing the path for node.js on my machine. I tried the fix that was given, which was to create a link between the nvm path to node and usr/local/bin/node but that didn't work either. I have since uninstalled nvm in hopes that just having good old node.js installed by itself to do the trick. Still no luck.
The error:
Couldn't find Node.js. Make sure it's in your $PATH by running node -v in your command-line.
Which is an alert from the Sublime app that only happens when I try to save a file.
Other things I have tried:
Updating my .bash_profile to make sure my PATH was correct. Updating my .bash_exports to make sure my PATH and NODE_PATH are correct. Updated my machine to macOS Sierra.
In iTerm:
node -v returns v11.3.0
which node returns /usr/local/bin/node
echo $PATH returns /usr/local/bin:/usr/local/share/npm/bin:/usr/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin/node
echo $NODE_PATH returns /usr/local/bin/node
Note: I don't want to uninstall Sublime as this is on my work machine and it's a pain in the butt to deal with IT with the sublime license.
After un-installing everything and re-installing everything, nothing worked. I gave up on n or nvm for the time being, and completely un-installed them. I even uninstalled Sublime and reinstalled it. The last thing I did was un-install and re-install sublimelinter eslint, which seemed to fix the issue. I'm not sure if that was really the fix, because I had already done that multiple times. The issue is resolved for the time being. I will update if the issue resurfaces.

Updated NPM but still showing as old version

Getting "npm: command not found" on this computer. Only way I knew to get it was by uninstalling node with Homebrew and reinstalling from the node.js site. Just reinstalled node.js on this computer and have npm version 2.5.1 with it.
I went to update to the newest (2.7.1) using:
sudo npm install npm -g
Updated without any errors, but running npm -v tells me I'm still on version 2.5.1
In the process of looking into the issue, see that old npm related files are on this computer. Old Changelog last modified 30 days ago exists saying "v2.7.1 (2015-03-05)" so npm was updated and on here at one point.
Can anyone point me in the right direction to figure out what is going wrong?
Making some assumptions here: there isn't anything really wrong, there just might be some installation issues. Homebrew should be just fine for installing node, Thoughtbot uses it to set-up laptops (see here).
To make sure Node/NPM installation is done in a smooth way, I did this:
sudo chown -R $USER /usr/local
Per this post.
I am on Yosemite and I haven't had any issues using this set-up, especially when updating NPM (did it when I read your question).

Resources