5

I have installed node.js v0.8.8 both from the pkg installer and compiled from source. Yet I get the following error when trying to run npm. Any help would be appreciated.

>  $ npm --help
> 
> /usr/lib/node_modules/npm/lib/utils/config-defs.js:5   , stdio =
> process.binding("stdio")
>                     ^ Error: No such module
>     at Object.<anonymous> (/usr/lib/node_modules/npm/lib/utils/config-defs.js:5:21)
>     at Module._compile (module.js:449:26)
>     at Object.Module._extensions..js (module.js:467:10)
>     at Module.load (module.js:356:32)
>     at Function.Module._load (module.js:312:12)
>     at Module.require (module.js:362:17)
>     at require (module.js:378:17)
>     at Object.<anonymous> (/usr/lib/node_modules/npm/lib/utils/ini.js:43:18)
>     at Module._compile (module.js:449:26)
>     at Object.Module._extensions..js (module.js:467:10)
1
  • 1
    Hehehe, "no suck module". Don't correct that. :) Commented Aug 30, 2012 at 14:25

2 Answers 2

9

I had the exact same issue upgrading from Node.JS 0.4 to 0.8. What worked for me was the following:

The OSX Node.JS package installer erroneously does not remove the old 0.4 npm installation in /usr/bin, which then conflicts with the new 0.8 one in /usr/local/bin. It just overwrites whatever is there already. I nuked the old one by deleting it, but to make sure, I decided a clean install would be better:

curl https://npmjs.org/install.sh | sudo clean=yes sh

There was one last problem: after the install, even though a which npm correctly returns /usr/local/bin/npm, bash kept trying to execute from /usr/bin. This is because on OSX, bash has hashed the executable name. The hashing saves repeated searches of all directories in your PATH every time you execute common programs. A hash -r at the command line took care of this issue.

Sign up to request clarification or add additional context in comments.

1 Comment

No luck on this for me, upgraded from node 0.4 to 0.10.
3

You are most likely using an old NPM version somehow. see: npm issue

2 Comments

Thanks, I had to clone the git repo (git://github.com/isaacs/npm.git), then had to manually remove everything /usr/lib/node_modules/npm, and /usr/bin/npm*) then run "sudo make install")
Huh... I wonder why node did not overwrite the npm binary when you compiled it from src...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.