-2

I am new to Angular and terminal use. I installed NPM and was trying to use ng serve and that is where the problems began. I am ready to completely uninstall everything and start over.

I have researched and tried uninstalling and reinstalling. I have cleared the cache. I tried adding to the bash_profile file and the .bashrc based on what other answers said to do but I think that made things worse. Every command I run says -bash: /usr/local/bin/npm: No such file or directory and nothing will work.

I tried following other uninstall tutorials but I just get more errors.

 npm help

bash: /usr/local/bin/npm: No such file or directory

npm deactivate

bash: /usr/local/bin/npm: No such file or directory

double-beep
  • 5,031
  • 17
  • 33
  • 41
sydney
  • 83
  • 1
  • 2
  • 11
  • The errors are quite clear - there's no "npm" binary in `/usr/local/bin/`. You either uninstalled it already or it resides somewhere else (e.g. maybe in `/usr/bin`). Execute `whereis npm`. It should return the path to npm and you'll be able to fix the problem. – Tomasz Kasperczyk May 24 '19 at 15:15
  • then npm is clearly not installed. You need to install it again. – Tomasz Kasperczyk May 24 '19 at 15:32
  • but when I type `npm -v` it shows 6.9.0 – sydney May 24 '19 at 15:33
  • Are you even using Linux? Your comment from @md-ullash's answer suggests you're actually on macOS... – Tomasz Kasperczyk May 24 '19 at 15:35
  • Yep, that explains everything. `apt` is a package manager for Debian-derived Linux distributions. Unfortunately, I don't have experience with macOs and can't help you with this. – Tomasz Kasperczyk May 24 '19 at 15:42

1 Answers1

0

Install new version of Node.js and NPM from here https://nodejs.org/en/download/:

sudo apt install nodejs npm

There might be installation issue. If you try more, I believe you can do. You can also take help from here https://www.w3schools.com/nodejs/

Bohemian
  • 412,405
  • 93
  • 575
  • 722
md ullash
  • 7
  • 2
  • I installed the newest version of nodejs. When I type "sudo apt update" I get "Unable to locate an executable at "/Library/Java/JavaVirtualMachines/jdk-9.0.1.jdk/Contents/Home/bin/apt" (-1)" – sydney May 24 '19 at 15:20