Error: exec npm config get prefix ERROR: Command failed: npm config get prefix [How to Solve]

Error: exec NPM config get prefix error: command failed: NPM config get prefix — a solution to NPM error reporting

Directory error: exec NPM config get prefix error: command failed: NPM config get prefix — a solution to NPM error reporting content solution how error reporting occurs

Error content

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

Error: Cannot find module 'process-nextick-args'
Require stack:
- C:\Users\wh2008112\AppData\Roaming\npm\node_modules\npm\node_modules\readable-stream\lib\_stream_readable.js
      ....

Solution:

Find NPM cache and NPM folder (previous version of NPM cache) in roaming folder

Roaming Directory:

C:\Users\Administrator\AppData\Roaming

Move NPM cache and NPM folder into nodejs folder

3. Check the NPM version, that is, solve the problem

npm -v

How do errors occur

In the process of NPM install failure, the NPM package was downgraded (down to 3.8, up to now the NPM version is 8.3.X). This problem occurred when upgrading again

It may be caused by the inconsistency between the old version of NPM and the new version of NPM cache directory. So that repeated redoing of nodejs can not be solved. You can only manually move the folder for operation.

Similar Posts: