Treefish Zhang
Treefish Zhang

Reputation: 1161

'Cannot find module 'process-nextick-args' npm error after reinstalling node.js in Windows10

I downloaded Node.js (4.4.5 LTS) from the official site and installed it to update node in my Windows10, and found npm not working(node worked).I uninstalled node by installing it in "remove" mode, and then reinstalled, but the error persisted. The error upon npm -v is as follows: ``` module.js:327 throw err; ^

Error: Cannot find module 'process-nextick-args'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> 

(C:\Users\<my-name>\AppData\Roaming\npm\node_modules\np
    m\node_modules\readable-stream\lib\_stream_readable.js:6:23)
        at Module._compile (module.js:409:26)
        at Object.Module._extensions..js (module.js:416:10)
        at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)

Per suggestions from [this link][2] I have edited the PATH of Environmental Variables (in both User and System) to include: C:\Users\\AppData\Roaming\npm and C:\Program Files\nodejs With 'which npm' it produced: /c/Program Files/nodejs/npm With 'whereis npm' it showed: npm: /cygdrive/c/Program Files/nodejs/npm /cygdrive/c/Program Files/nodejs/npm.cmd With 'which node' I got /c/Program Files/nodejs/node ```

Would appreciate any suggestions.

link2: Installing Node.js (and npm) on Windows 10

Upvotes: 2

Views: 7768

Answers (2)

Existe Deja
Existe Deja

Reputation: 1379

I had this problem after a brew update. I'm using nvm so I just reconfigured nvm to use my version with nvm use vx.x.x

Upvotes: 0

Treefish Zhang
Treefish Zhang

Reputation: 1161

Per this link it is necessary to delete node and node_modules from 'local' directories in order to remove node (and npm) completely. Thinking I only need to remove old npm relics to solve the error about 'Error: Cannot find module 'process-nextick-args', I tried deleting npm and npm-cache inside AppData/Roaming directory manually, followed by reinstalling node in 'repair' mode, and (after restart) finally npm works.

Upvotes: 2

Related Questions