npm uninstall -g not working not able to uninstall babel-node

I tried to npm uninstall -g is not working.

First I had tried npm ls -g --depth=0 it produced the following results

  ├── UNMET PEER DEPENDENCY @babel/core@7.0.0-beta.4
  ├── @babel/node@7.0.0-beta.44
  ├── aws-cli@0.0.2
  ├── babel-core@6.26.0
  ├── babel-loader@7.1.4
  ├── babel-plugin-transform-decorators-legacy@1.3.4
  ├── babel-plugin-transform-object-rest-spread@6.26.0
  ├── babel-plugin-transform-optional-chaining@7.0.0-beta.3
  ├── babel-preset-react@6.24.1
  ├── babel-preset-stage-3@6.24.1
  ├── babel-register@7.0.0-beta.3
  ├── coffeescript@2.2.4
  ├── graceful-fs@4.1.11
  ├── minimatch@3.0.4
  ├── n@2.1.8
  ├── npm@5.8.0
  ├── ntdl@1.0.2
  ├── pdf-compress@1.0.0 -> /home/ubuntu/workarea/sourcecode/pdf-optimise
  ├── virtualenv@0.3.1
  ├── UNMET PEER DEPENDENCY webpack@2 || 3 || 4
  └── yarn@1.5.1

  npm ERR! peer dep missing: @babel/core@7.0.0-beta.44, required by
  npm ERR! peer dep missing: webpack@2 || 3 || 4, required by babel-
  npm ERR! peer dep missing: @babel/core@7.0.0-beta.44, required by
  npm ERR! peer dep missing: webpack@>=0.9 <2 || ^2.1.0-beta || ^2.2.0,
  required by worker-loader@0.8.1
Then I had tried uninstalling it didn't succeeded

  root@ip-10-252-14-11:/home/ubuntu/workarea/sourcecode/ntdl# sudo npm
  uninstall -g @babel/node@7.0.0-beta.44
  up to date in 0.063s

  root@ip-10-252-14-11:/home/ubuntu/workarea/sourcecode/ntdl# babel-node --

Then I tried

  root@ip-10-252-14-11:/home/ubuntu/workarea/sourcecode/ntdl# npm uninstall
  -g *
  npm ERR! code ENOLOCAL
  npm ERR! Could not install from
  "../../home/ubuntu/workarea/sourcecode/ntdl" as it does not contain a
  package.json file.

  npm ERR! A complete log of this run can be found in:
  npm ERR!     /root/.npm/_logs/2018-04-10T01_33_46_993Z-debug.log
Please help me in resolving this issue.

With Many Thanks,

Bharath AK
Bharath A.KAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
Have you tried re-installing it and then removing it?
Bharath A.KAuthor Commented:
Hi Julian,

       I had done the same steps of what you mentioned.  I had uninstalled npm removed the babel-node manually.  and deleted all folders under node_modules.  Then Installed every thing once again.  Now it is working fine.

With Many Thanks,
Bharath AK
Julian HansenCommented:
You are welcome.

Do you still need assistance with this question?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bharath A.KAuthor Commented:

No I don't need assistance with this question.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.