Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

This is what I get when I try to install express for node.js

npm install express

module.js:340
    throw err;
          ^
Error: Cannot find module 'graceful-fs'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (/usr/share/npm/lib/utils/ini.js:32:10)
    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)

I even tried others and still got the same error. I did some digging and i did find 'gracefui-fs' on my server.

I am running ubuntu 12.04 LTS on an amazon ec2 server. Node installed with no errors, and npm still didn't work. I also un installed and re installed npm using

apt-get

as well as from source. During installation I received no errors either.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
646 views
Welcome To Ask or Share your Answers For Others

1 Answer

Had the same problem. Don't download npm from aptitude or apt-get.

Instead try:

git clone --depth=1 git://github.com/npm/cli.git
cd cli/scripts
chmod +x install.sh
sudo ./install.sh

saw it here: NPM can't install appjs. Error: Cannot find module 'graceful-fs'


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...