Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

TerrePorter's avatar

weird npm error

Hey all, I'm trying to run the npm install but I'm getting a error that I'm not finding much online about.

TypeError: isexe is not a function
    at E (/usr/lib/node_modules/npm/node_modules/which/which.js:82:7)
    at F (/usr/lib/node_modules/npm/node_modules/which/which.js:91:7)
    at which (/usr/lib/node_modules/npm/node_modules/which/which.js:92:5)
    at load (/usr/lib/node_modules/npm/lib/npm.js:250:5)
    at EventEmitter.npm.load (/usr/lib/node_modules/npm/lib/npm.js:246:5)
    at /usr/lib/node_modules/npm/bin/npm-cli.js:79:7
    at Object.<anonymous> (/usr/lib/node_modules/npm/bin/npm-cli.js:155:3)
    at Module._compile (internal/modules/cjs/loader.js:1114:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:979:32)
/usr/lib/node_modules/npm/lib/npm.js:59
      throw new Error('npm.load() required')
      ^

Error: npm.load() required
    at Object.get (/usr/lib/node_modules/npm/lib/npm.js:59:13)
    at process.errorHandler (/usr/lib/node_modules/npm/lib/utils/error-handler.js:208:32)
    at process.emit (events.js:400:28)
    at process._fatalException (internal/process/execution.js:167:25)

Anyone know how to fix this?

nmp -v : 6.14.18

0 likes
6 replies
LaryAI's avatar
Level 58

It looks like you're encountering an issue with your npm installation. The error message suggests that there's a problem with the which module that npm uses internally, or there could be a broader issue with your npm installation.

Here are a few steps you can try to resolve the issue:

  1. Clear npm's cache: Sometimes, the cache can cause issues. You can force clear it by running:

    npm cache clean --force
    
  2. Reinstall npm: If clearing the cache doesn't work, you might need to reinstall npm. Since you're using a global installation of npm, you can try reinstalling it using your package manager. For example, if you're using a system that uses apt (like Ubuntu), you can run:

    sudo apt-get remove npm
    sudo apt-get install npm
    

    Or if you're on a system that uses brew (like macOS), you can run:

    brew uninstall npm
    brew install npm
    
  3. Check your Node.js installation: Sometimes, npm issues can be related to your Node.js installation. Ensure that Node.js is properly installed and consider upgrading to the latest stable version if you're not already using it. You can check your Node.js version with:

    node -v
    

    And if you need to install or update Node.js, you can download it from the official website or use a version manager like nvm to manage multiple Node.js versions.

  4. Check your system's PATH: Ensure that the system PATH includes the directory where npm is installed. This can sometimes be an issue if npm is not recognized as a command.

  5. Reinstall Node.js and npm: If none of the above steps work, you might have to completely uninstall Node.js and npm and then reinstall them. This will ensure that you have a clean installation of both Node.js and npm.

Remember to close and reopen your terminal or command prompt after making these changes to ensure that your environment variables are updated.

If you continue to experience issues after trying these steps, it might be helpful to look for any related issues on the npm GitHub repository or to post a question with the error message on Stack Overflow or another developer community for further assistance.

TerrePorter's avatar

I get the following trying Lary's suggestions.

$ sudo apt-get install npm
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 npm : Depends: nodejs (>= 6.11~)
       Depends: node-abbrev (>= 1.1.1~) but it is not going to be installed
       Depends: node-ajv but it is not going to be installed
       Depends: node-ansi but it is not going to be installed
       Depends: node-ansi-regex (>= 3.0~) but it is not going to be installed
       Depends: node-ansi-styles but it is not going to be installed
       Depends: node-ansistyles but it is not going to be installed
       Depends: node-aproba but it is not going to be installed
       Depends: node-archy (>= 1.0~) but it is not going to be installed
       Depends: node-are-we-there-yet but it is not going to be installed
       Depends: node-asap but it is not going to be installed
       Depends: node-asn1 but it is not going to be installed
       Depends: node-assert-plus but it is not going to be installed
       Depends: node-asynckit but it is not going to be installed
       Depends: node-aws4 but it is not going to be installed
       Depends: node-aws-sign2 but it is not going to be installed
       Depends: node-balanced-match but it is not going to be installed
       Depends: node-bcrypt-pbkdf but it is not going to be installed
       Depends: node-bl but it is not going to be installed
       Depends: node-bluebird but it is not going to be installed
       Depends: node-boxen but it is not going to be installed
       Depends: node-brace-expansion but it is not going to be installed
       Depends: node-builtin-modules but it is not going to be installed
       Depends: node-builtins but it is not going to be installed
       Depends: node-cacache but it is not going to be installed
       Depends: node-call-limit but it is not going to be installed
       Depends: node-camelcase but it is not going to be installed
       Depends: node-caseless but it is not going to be installed
       Depends: node-chalk but it is not going to be installed
       Depends: node-chownr but it is not going to be installed
       Depends: node-ci-info but it is not going to be installed
       Depends: node-cli-boxes but it is not going to be installed
       Depends: node-cliui but it is not going to be installed
       Depends: node-clone but it is not going to be installed
       Depends: node-co but it is not going to be installed
       Depends: node-color-convert but it is not going to be installed
       Depends: node-color-name but it is not going to be installed
       Depends: node-colors but it is not going to be installed
       Depends: node-columnify but it is not going to be installed
       Depends: node-combined-stream but it is not going to be installed
       Depends: node-concat-map but it is not going to be installed
       Depends: node-concat-stream but it is not going to be installed
       Depends: node-config-chain but it is not going to be installed
       Depends: node-configstore but it is not going to be installed
       Depends: node-console-control-strings but it is not going to be installed
       Depends: node-copy-concurrently but it is not going to be installed
       Depends: node-core-util-is but it is not going to be installed
       Depends: node-cross-spawn but it is not going to be installed
       Depends: node-crypto-random-string but it is not going to be installed
       Depends: node-cyclist but it is not going to be installed
       Depends: node-dashdash but it is not going to be installed
       Depends: node-debug but it is not going to be installed
       Depends: node-decamelize but it is not going to be installed
       Depends: node-deep-extend but it is not going to be installed
       Depends: node-defaults but it is not going to be installed
       Depends: node-define-properties but it is not going to be installed
       Depends: node-delayed-stream but it is not going to be installed
       Depends: node-delegates but it is not going to be installed
       Depends: node-detect-indent but it is not going to be installed
       Depends: node-detect-newline but it is not going to be installed
       Depends: node-dot-prop but it is not going to be installed
       Depends: node-duplexer3 but it is not going to be installed
       Depends: node-duplexify but it is not going to be installed
       Depends: node-ecc-jsbn but it is not going to be installed
       Depends: node-editor but it is not going to be installed
       Depends: node-encoding but it is not going to be installed
       Depends: node-end-of-stream but it is not going to be installed
       Depends: node-err-code but it is not going to be installed
       Depends: node-errno but it is not going to be installed
       Depends: node-es6-promise but it is not going to be installed
       Depends: node-escape-string-regexp but it is not going to be installed
       Depends: node-execa but it is not going to be installed
       Depends: node-extend but it is not going to be installed
       Depends: node-extsprintf but it is not going to be installed
       Depends: node-fast-deep-equal but it is not going to be installed
       Depends: node-find-up but it is not going to be installed
       Depends: node-flush-write-stream but it is not going to be installed
       Depends: node-forever-agent but it is not going to be installed
       Depends: node-form-data but it is not going to be installed
       Depends: node-from2 but it is not going to be installed
       Depends: node-fs.realpath but it is not going to be installed
       Depends: node-fs-vacuum but it is not going to be installed
       Depends: node-fs-write-stream-atomic but it is not going to be installed
       Depends: node-function-bind but it is not going to be installed
       Depends: node-gauge but it is not going to be installed
       Depends: node-genfun but it is not going to be installed
       Depends: node-get-caller-file but it is not going to be installed
       Depends: node-getpass but it is not going to be installed
       Depends: node-glob (>= 7.1.2~) but it is not going to be installed
       Depends: node-got but it is not going to be installed
       Depends: node-graceful-fs (>= 4.1.11~) but it is not going to be installed
       Depends: node-gyp (>= 3.6.2~) but it is not going to be installed
       Depends: node-har-schema but it is not going to be installed
       Depends: node-har-validator but it is not going to be installed
       Depends: node-has-flag but it is not going to be installed
       Depends: node-has-unicode but it is not going to be installed
       Depends: node-hosted-git-info (>= 2.6~) but it is not going to be installed
       Depends: node-http-signature but it is not going to be installed
       Depends: node-iconv-lite but it is not going to be installed
       Depends: node-iferr but it is not going to be installed
       Depends: node-import-lazy but it is not going to be installed
       Depends: node-imurmurhash but it is not going to be installed
       Depends: node-inflight but it is not going to be installed
       Depends: node-inherits (>= 2.0.3~) but it is not going to be installed
       Depends: node-ini (>= 1.3.5~) but it is not going to be installed
       Depends: node-invert-kv but it is not going to be installed
       Depends: node-ip but it is not going to be installed
       Depends: node-ip-regex but it is not going to be installed
       Depends: node-isarray but it is not going to be installed
       Depends: node-isexe but it is not going to be installed
       Depends: node-is-npm but it is not going to be installed
       Depends: node-is-obj but it is not going to be installed
       Depends: node-is-path-inside but it is not going to be installed
       Depends: node-is-retry-allowed but it is not going to be installed
       Depends: node-is-stream but it is not going to be installed
       Depends: node-isstream but it is not going to be installed
       Depends: node-is-typedarray but it is not going to be installed
       Depends: node-jsbn but it is not going to be installed
       Depends: node-jsonparse but it is not going to be installed
       Depends: node-json-parse-better-errors but it is not going to be installed
       Depends: node-json-schema but it is not going to be installed
       Depends: node-json-schema-traverse but it is not going to be installed
       Depends: node-jsonstream (>= 1.3.2~) but it is not going to be installed
       Depends: node-json-stringify-safe but it is not going to be installed
       Depends: node-jsprim but it is not going to be installed
       Depends: node-latest-version but it is not going to be installed
       Depends: node-lazy-property but it is not going to be installed
       Depends: node-lcid but it is not going to be installed
       Depends: node-libnpx but it is not going to be installed
       Depends: node-locate-path but it is not going to be installed
       Depends: node-lodash but it is not going to be installed
       Depends: node-lockfile (>= 1.0.3~) but it is not going to be installed
       Depends: node-lowercase-keys but it is not going to be installed
       Depends: node-lru-cache (>= 4.1.1~) but it is not going to be installed
       Depends: node-make-dir but it is not going to be installed
       Depends: node-mem but it is not going to be installed
       Depends: node-mime but it is not going to be installed
       Depends: node-mime-types but it is not going to be installed
       Depends: node-mimic-fn but it is not going to be installed
       Depends: node-minimatch but it is not going to be installed
       Depends: node-minimist but it is not going to be installed
       Depends: node-mississippi but it is not going to be installed
       Depends: node-mkdirp (>= 0.5.1~) but it is not going to be installed
       Depends: node-move-concurrently but it is not going to be installed
       Depends: node-ms but it is not going to be installed
       Depends: node-mute-stream but it is not going to be installed
       Depends: node-nopt but it is not going to be installed
       Depends: node-normalize-package-data (>= 2.4~) but it is not going to be installed
       Depends: node-npm-bundled but it is not going to be installed
       Depends: node-npm-package-arg (>= 6.1.1) but it is not going to be installed
       Depends: node-npmlog (>= 4.1.2~) but it is not going to be installed
       Depends: node-number-is-nan but it is not going to be installed
       Depends: node-oauth-sign but it is not going to be installed
       Depends: node-object-assign but it is not going to be installed
       Depends: node-once (>= 1.4~) but it is not going to be installed
       Depends: node-opener but it is not going to be installed
       Depends: node-osenv (>= 0.1.5~) but it is not going to be installed
       Depends: node-os-locale but it is not going to be installed
       Depends: node-os-tmpdir but it is not going to be installed
       Depends: node-package-json but it is not going to be installed
       Depends: node-parallel-transform but it is not going to be installed
       Depends: node-path-exists but it is not going to be installed
       Depends: node-path-is-absolute but it is not going to be installed
       Depends: node-path-is-inside but it is not going to be installed
       Depends: node-promise-inflight but it is not going to be installed
       Depends: node-promise-retry but it is not going to be installed
       Depends: node-promzard but it is not going to be installed
       Depends: node-performance-now but it is not going to be installed
       Depends: node-p-finally but it is not going to be installed
       Depends: node-p-is-promise but it is not going to be installed
       Depends: node-pify but it is not going to be installed
       Depends: node-p-limit but it is not going to be installed
       Depends: node-p-locate but it is not going to be installed
       Depends: node-prepend-http but it is not going to be installed
       Depends: node-process-nextick-args but it is not going to be installed
       Depends: node-proto-list but it is not going to be installed
       Depends: node-prr but it is not going to be installed
       Depends: node-pseudomap but it is not going to be installed
       Depends: node-psl but it is not going to be installed
       Depends: node-pump but it is not going to be installed
       Depends: node-pumpify but it is not going to be installed
       Depends: node-punycode but it is not going to be installed
       Depends: node-qs but it is not going to be installed
       Depends: node-qw but it is not going to be installed
       Depends: node-rc but it is not going to be installed
       Depends: node-read (>= 1.0.7~) but it is not going to be installed
       Depends: node-readable-stream but it is not going to be installed
       Depends: node-read-package-json (>= 2.0.13~) but it is not going to be installed
       Depends: node-registry-auth-token but it is not going to be installed
       Depends: node-registry-url but it is not going to be installed
       Depends: node-request (>= 2.83~) but it is not going to be installed
       Depends: node-require-main-filename but it is not going to be installed
       Depends: node-require-directory but it is not going to be installed
       Depends: node-resolve-from (>= 4.0~) but it is not going to be installed
       Depends: node-retry (>= 0.10.1~) but it is not going to be installed
       Depends: node-rimraf (>= 2.6.2~) but it is not going to be installed
       Depends: node-run-queue but it is not going to be installed
       Depends: node-safe-buffer but it is not going to be installed
       Depends: node-semver (>= 5.5~) but it is not going to be installed
       Depends: node-set-blocking but it is not going to be installed
       Depends: node-sha (>= 2.0.1~) but it is not going to be installed
       Depends: node-shebang-command but it is not going to be installed
       Depends: node-shebang-regex but it is not going to be installed
       Depends: node-signal-exit but it is not going to be installed
       Depends: node-slide (>= 1.1.6~) but it is not going to be installed
       Depends: node-sorted-object but it is not going to be installed
       Depends: node-slash but it is not going to be installed
       Depends: node-semver-diff but it is not going to be installed
       Depends: node-spdx-correct but it is not going to be installed
       Depends: node-spdx-exceptions but it is not going to be installed
       Depends: node-spdx-expression-parse but it is not going to be installed
       Depends: node-spdx-license-ids but it is not going to be installed
       Depends: node-sshpk but it is not going to be installed
       Depends: node-ssri but it is not going to be installed
       Depends: node-stream-each but it is not going to be installed
       Depends: node-stream-iterate but it is not going to be installed
       Depends: node-stream-shift but it is not going to be installed
       Depends: node-strict-uri-encode but it is not going to be installed
       Depends: node-string-decoder but it is not going to be installed
       Depends: node-string-width but it is not going to be installed
       Depends: node-strip-ansi (>= 4.0~) but it is not going to be installed
       Depends: node-strip-json-comments but it is not going to be installed
       Depends: node-strip-eof but it is not going to be installed
       Depends: node-supports-color but it is not going to be installed
       Depends: node-tar (>= 4.4~) but it is not going to be installed
       Depends: node-term-size but it is not going to be installed
       Depends: node-text-table but it is not going to be installed
       Depends: node-through but it is not going to be installed
       Depends: node-through2 but it is not going to be installed
       Depends: node-timed-out but it is not going to be installed
       Depends: node-tough-cookie but it is not going to be installed
       Depends: node-tunnel-agent but it is not going to be installed
       Depends: node-tweetnacl but it is not going to be installed
       Depends: node-typedarray but it is not going to be installed
       Depends: node-uid-number but it is not going to be installed
       Depends: node-unique-filename but it is not going to be installed
       Depends: node-unique-string but it is not going to be installed
       Depends: node-unpipe but it is not going to be installed
       Depends: node-url-parse-lax but it is not going to be installed
       Depends: node-util-deprecate but it is not going to be installed
       Depends: node-uuid but it is not going to be installed
       Depends: node-validate-npm-package-name but it is not going to be installed
       Depends: node-verror but it is not going to be installed
       Depends: node-which (>= 1.3~) but it is not going to be installed
       Depends: node-which-module but it is not going to be installed
       Depends: node-wide-align but it is not going to be installed
       Depends: node-widest-line but it is not going to be installed
       Depends: node-wrap-ansi but it is not going to be installed
       Depends: node-wrappy but it is not going to be installed
       Depends: node-wcwidth.js but it is not going to be installed
       Depends: node-write-file-atomic but it is not going to be installed
       Depends: node-xdg-basedir but it is not going to be installed
       Depends: node-xtend but it is not going to be installed
       Depends: node-yargs but it is not going to be installed
       Depends: node-yargs-parser but it is not going to be installed
       Depends: node-yallist but it is not going to be installed
       Depends: node-y18n but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
$ node -v
v14.21.3
Sarbamoy's avatar

Hey. Were you able to resolve the issue? I am facing the exact same issue.

TerrePorter's avatar

@Sarbamoy I was not able to figure it out. I ended up just updating my homestead box instead.

KeithHalsey's avatar

Getting the exact same errors after updating to laravel 10. If anyone finds a solution, please post here! Thanks in anticipation

8krisv's avatar

I was getting the same error, then I followed the official guide for nodejs installation with nvm (Node Version Manager) from the nodejs official page ("https://nodejs.org/en/download") and this works for me

Please or to participate in this conversation.