help icon indicating copy to clipboard operation
help copied to clipboard

cannot find module '/usr/bin/npm'

Open pagkly opened this issue 5 years ago • 9 comments

  • 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

image

pagkly avatar Apr 06 '20 06:04 pagkly

can you share the output of: which node and which npm ?

gireeshpunathil avatar Dec 02 '20 12:12 gireeshpunathil

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.

ochen1 avatar Apr 21 '21 15:04 ochen1

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 also having the same issue and I'm running proot

RehanPlayz avatar Oct 10 '21 06:10 RehanPlayz

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

RehanPlayz avatar Oct 10 '21 07:10 RehanPlayz

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: []
}

RehanPlayz avatar Oct 10 '21 07:10 RehanPlayz

Let me know if anyone finds a solution

RehanPlayz avatar Oct 10 '21 07:10 RehanPlayz

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.

gireeshpunathil avatar Jun 22 '23 11:06 gireeshpunathil

Yes, same issue when installed inside a fakechroot chroot.

ulrichard avatar Sep 04 '23 13:09 ulrichard

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.

github-actions[bot] avatar May 13 '24 01:05 github-actions[bot]

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.

github-actions[bot] avatar Jun 12 '24 01:06 github-actions[bot]