0

I have recently started learning and attempting to use the npx mix commands but whenever I try to execute the command it returns this error:

node:internal/modules/cjs/loader:949
  throw err;
  ^

Error: Cannot find module 'libnpx'
Require stack:
- /usr/share/npm/bin/npx-cli.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:946:15)
    at Module._load (node:internal/modules/cjs/loader:787:27)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/usr/share/npm/bin/npx-cli.js:3:13)
    at Module._compile (node:internal/modules/cjs/loader:1112:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1166:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Module._load (node:internal/modules/cjs/loader:834:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/share/npm/bin/npx-cli.js' ]
}

I am not sure how to fix this problem - any help with solving this would be greatly appreciated!

Calum Childs
  • 337
  • 2
  • 12
  • 1
    what version of node and npm do you have? Have you tried the latest version of npm? – apokryfos Jul 11 '22 at 14:18
  • @apokryfos I have version 18 of Node.js and version 5 of NPM. I can't update NPM because I'm missing the "semver" module and I'm not sure how I can install it. – Calum Childs Jul 12 '22 at 05:30
  • semver is a dependency of npm and should normally be installed if you try to install npm usually to update npm you'd do something like `sudo npm -g install npm@latest` though if you're on windows the process might be different. – apokryfos Jul 12 '22 at 06:30
  • It came with this error when I tried your command: https://pastebin.com/zwu8UswA – Calum Childs Jul 12 '22 at 07:06
  • 1
    https://stackoverflow.com/questions/33870520/npm-install-cannot-find-module-semver seems to suggest you'll need to do something akin to completely reinstalling node – apokryfos Jul 12 '22 at 07:11

0 Answers0