npm / cli

the package manager for JavaScript

Home Page:https://docs.npmjs.com/cli/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[DOCS] npm removal using make, no Makefile in project directory

avinal opened this issue · comments

Is there an existing issue for this?

  • I have searched the existing issues

This is a CLI Docs Problem, not another kind of Docs Problem.

  • This is a CLI Docs Problem.

Description of Problem

I am trying to uninstall npm because I am getting this error message and no matter what command I try it is not working.

Cannot load externalized builtin: "internal/deps/cjs-module-lexer/lexer:/usr/lib/node_modules/cjs-module-lexer/lexer.js".
----- Native stack trace -----

 1: 0x7fb2655f8fa4 node::builtins::BuiltinLoader::AddExternalizedBuiltin(char const*, char const*) [/lib64/libnode.so.115]
 2: 0x7fb2655f9193 node::builtins::BuiltinLoader::BuiltinLoader() [/lib64/libnode.so.115]
 3: 0x7fb26554e737 node::InitializePrimordials(v8::Local<v8::Context>) [/lib64/libnode.so.115]
 4: 0x7fb26554e868 node::GetPerContextExports(v8::Local<v8::Context>) [/lib64/libnode.so.115]
 5: 0x7fb26554e648 node::InitializePrimordials(v8::Local<v8::Context>) [/lib64/libnode.so.115]
 6: 0x7fb26554e940 node::InitializeMainContextForSnapshot(v8::Local<v8::Context>) [/lib64/libnode.so.115]
 7: 0x7fb26554e965 node::InitializeContext(v8::Local<v8::Context>) [/lib64/libnode.so.115]
 8: 0x7fb26554e9c3 node::NewContext(v8::Isolate*, v8::Local<v8::ObjectTemplate>) [/lib64/libnode.so.115]
 9: 0x7fb26567d024 node::NodeMainInstance::CreateMainEnvironment(node::ExitCode*) [/lib64/libnode.so.115]
10: 0x7fb26567d17b node::NodeMainInstance::Run() [/lib64/libnode.so.115]
11: 0x7fb2655e2999 node::Start(int, char**) [/lib64/libnode.so.115]
12: 0x7fb264a3d088  [/lib64/libc.so.6]
13: 0x7fb264a3d14b __libc_start_main [/lib64/libc.so.6]
14: 0x55b0be61e035 _start [node]
[1]    456973 IOT instruction (core dumped)  npm list -g --depth=0

I was following the guide to uninstall npm,

Or, if that fails, get the npm source code, and do:
```bash
sudo make uninstall
```

But there is no Makefile in the project repository root. Am I looking at the wrong repository or missing something.

Potential Solution

Update the docs with accurate info about removing npm.

Affected URL

https://docs.npmjs.com/cli/v10/using-npm/removal

I'm also seeing this error even when running npm --version. But I have npm installed via default Fedora (40) repos. Did you install this manually?

commented

That is very outdated info in that doc file, it should be removed.

I'm also seeing this error even when running npm --version. But I have npm installed via default Fedora (40) repos. Did you install this manually?

I don't exactly remember, it was a long time ago. Everything was working fine until I upgraded to Fedora 40 and tried updating some packages.

I was able to workaround/fix this by running sudo dnf remove nodejs-npm nodejs yarnpkg && sudo dnf install nodejs-npm nodejs yarnpkg. For whatever reason, dnf reinstall didn't work, but removing and installing did.

I will open a PR to remove the particular instruction.