5

I'm sort of new to this whole "node" js thing. When trying to install the MEAN package from http://mean.io/, I followed these steps faithfully:

I "cd" to my directory, run "npm install", and then the "grunt" command, and get this error:

Error: Cannot find module 'coffee-script'

So I roll with the punches. npm install coffee-script, run "grunt" again.

Error: Cannot find module 'getobject'

Ever patient, I decide "okay, forget grunt". I run "node server". Then I get this error:

Error: Cannot find module 'merge-descriptors'

What's wrong? How can I get MEAN working here? (I thought npm was supposed to make life easier).

Update 12/31/13: When I look at the output of npm install, there are a number of "Error: EMFILE" errors. As I understand those errors are related to too many files being opened and graceful-fs is a solution to this. Sample EMFILE error pasted below:

npm ERR! System Darwin 13.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/cnokes/Desktop/mean-master
npm ERR! node -v v0.10.7
npm ERR! npm -v 1.2.21
npm ERR! path /Users/cnokes/Desktop/mean-master/node_modules/grunt/node_modules/iconv-lite/README.md
npm ERR! code EMFILE
npm ERR! errno 20
npm ERR! tar.unpack error reading /var/folders/wv/xrm8qphn5bsgfj5w45kqrwl9lgq2j2/T/npm-27019/1388513549132-0.22752901865169406/tmp.tgz

With graceful-fs installed, I re-run npm install and get a couple of these errors:

npm ERR! Error: ENOENT, utime '/Users/cnokes/Downloads/mean-master2/node_modules/express/node_modules/fresh/index.js'
ccnokes
  • 6,885
  • 5
  • 47
  • 54
  • I was able to reproduce this – jsplaine Dec 20 '13 at 00:46
  • Clearly, I'm missing something that's probably basic to Node. If I go to the node modules that are throwing the above errors and "npm install" their dependencies, those modules stop throwing errors but their dependencies are duplicates of global dependencies sometimes. So, I'm confused. – ccnokes Dec 20 '13 at 01:00
  • I have not looked into mean.io, perhaps they use modules but did not get included in the dependencies or maybe an issue with grunt [?] But, what if you manually install the 3 modules and see if you can manually install them? npm install coffee-script npm install getobject npm install merge-descriptors – C. S. Dec 20 '13 at 02:33
  • I've gone through manually installing those modules and more of them, still no luck. I finally decided I would just run npm install on each node_module required for MEAN. Doing that resulted in a lot of duplicate modules. For example, both MEAN and Express require the "buffer-crc32" module, but Express doesn't seem to see that module is available in the global application, and will only work if that module is in the /express/node_modules/buffer-crc32 folder (as opposed to the global application folder, MEAN/node_modules/buffer-crc32). Hopefully that makes sense. – ccnokes Dec 20 '13 at 16:47
  • I am encountering the exact same problem. Were you able to find a solution for this? – Saket Dec 31 '13 at 14:18
  • Not yet @Saket. I opened an issue here https://github.com/linnovate/mean/issues/221. If there's a resolution that someone else doesn't post here, I'll be sure to post it. – ccnokes Dec 31 '13 at 18:02
  • are those binaries by chance? I usually have to install binaries with `-g` flag. – chovy Dec 31 '13 at 18:10
  • What operating system are you using? It works fine for me both on osx and linux. – Lior Kesos Dec 24 '13 at 23:09
  • When you copied the directory, did you copy the files using finder or did your u go next the directory with the terminal? – Lior Kesos Dec 31 '13 at 18:08
  • What your are describing is normally accounted to not running "npm install" in the directory or copying the projects without some of the hidden files (files that start with . in their names). Feel free to reachout at skype (I'm liorkesos) and I'll try to help you out remotely. – Lior Kesos Dec 31 '13 at 18:11
  • Thanks Lior, I added some more detail above. I'm swamped at work today so I can't spend much more time on this. I'll continue debugging a bit later and will reach out if I can't work it out. – ccnokes Dec 31 '13 at 18:49

1 Answers1

2

I've run in to this and think this might be connected to another issue. Basically it's related to the number of open files (alot) that get open when we do a npm install. It has been blogged about nicely here - http://otaqui.com/blog/1618/how-to-fix-error-emfile-too-many-open-files-from-yeoman-and-npm/ and I update the mean FAQ https://github.com/linnovate/mean/wiki/Faq

Lior Kesos
  • 294
  • 1
  • 5
  • Thanks Lior. Running "ulimit -n 1024" from the terminal makes it so there's no EMFILE or ENOENT errors and everything installs correctly and runs. – ccnokes Jan 28 '14 at 21:51