After NPM install "npm -" does not work. "Error: Cannot find module 'process-nextick-args’"

npm

#1

Hi,

I am getting error whenever I am installing npm just after creating workspace. Here is sequence I followed:-1:

  1. Created a new workspace with node.js

  2. Except package.json deleted all files/folders

  3. Executed below command:
    eddienit:~/workspace $ node -v
    v6.11.2

    eddienit:~/workspace $ npm -v
    3.10.10

eddienit:~/workspace $ git --version
git version 2.14.1

  1. Now tried to install npm again with “npm install -g npm”
  2. then when I try to run any npm command it gives error:-1:
    eddienit:~/workspace $ npm init
    module.js:471
    throw err;
    ^

Error: Cannot find module 'process-nextick-args’
at Function.Module._resolveFilename (module.js:469:15)
at Function.Module._load (module.js:417:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/home/ubuntu/.nvm/versions/node/v6.11.2/lib/node_modules/npm/node_modules/readable-stream/lib/_stream_readable.js:26:23)
at Module._compile (module.js:570:32)
at Object.Module._extensions…js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)

Please help to resolve this issue.


#2

Update:- After some research solved it by updating the node.js version

nvm install 6.11.3 (after referrring node.js official latest recommended version)

Now npm install is working fine. :slight_smile:


#3

Thanks U!!! in my case the command: npm init cause a error, with your solution now it’s working fine!