cannot find module '/usr/bin/npm'
-
Node.js Version:10.17.0, also already tried the one downloaded from nodejs version 12 and 13 and the one from nvm all gave similar error
-
OS:Kali Linux 2019.2 amd64
-
Scope (install, code, runtime, meta, other?): cannot run npm at all already reinstall kali, nodejs, and npm several times but same result Kali linux 2019.2 arm64 with the same nodejs and npm version is working but not this one strangely
-
Module (and version) (if relevant): npm 6.14.3 same with 6.14.4

can you share the output of:
which node
and
which npm ?
I'm having the same issue. which node and which npm output /usr/bin/node and /usr/bin/npm respectively.
I'm running node inside a chroot (proot), so I think that may be the reason.
I'm having the same issue.
which nodeandwhich npmoutput/usr/bin/nodeand/usr/bin/npmrespectively.I'm running node inside a chroot (proot), so I think that may be the reason.
I'm also having the same issue and I'm running proot
I can install NodeJS and NPM fine using the apt install nodejs npm command but the version is really outdated so I used the NodeSource PPA to install the latest version but I'm getting this issue with NPM
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '/usr/local/bin/npm'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Let me know if anyone finds a solution
if you are installing node outside of the chroot and accessing it inside the chroot, the error is inevitable. and the obvious solution is to install it inside the chroot.
anyone having this issue - let me know if that is the case.
Yes, same issue when installed inside a fakechroot chroot.
It seems there has been no activity on this issue for a while, and it is being closed in 30 days. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.
It seems there has been no activity on this issue for a while, and it is being closed. If you believe this issue should remain open, please leave a comment. If you need further assistance or have questions, you can also search for similar issues on Stack Overflow. Make sure to look at the README file for the most updated links.