NodeJS - 设置mean.io无法找到模块错误

时间:2013-12-20 00:24:02

标签: javascript node.js

我对这整个“节点”js的事情有点新鲜。在尝试从http://mean.io/安装MEAN包时,我忠实地遵循了以下步骤:

我“cd”到我的目录,运行“npm install”,然后运行“grunt”命令,并收到此错误:

Error: Cannot find module 'coffee-script'

所以我用拳头滚动。 npm install coffee-script,再次运行“grunt”。

Error: Cannot find module 'getobject'

有耐心,我决定“好吧,忘了咕噜咕噜”。我运行“节点服务器”。然后我收到了这个错误:

Error: Cannot find module 'merge-descriptors'

怎么了?我怎样才能让MEAN在这里工作? (我认为npm应该让生活更轻松。)

更新12/31/13:当我查看npm install的输出时,会出现一些“Error:EMFILE”错误。据我所知,这些错误与打开的文件太多有关,而graceful-fs是解决这个问题的方法。粘贴在下面的示例EMFILE错误:

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

安装了graceful-fs后,我重新运行npm install并得到以下几个错误:

npm ERR! Error: ENOENT, utime '/Users/cnokes/Downloads/mean-master2/node_modules/express/node_modules/fresh/index.js'

1 个答案:

答案 0 :(得分:2)

我遇到过这种情况并认为这可能与另一个问题有关。 基本上它与我们进行npm安装时打开的打开文件(很多)的数量有关。 它在这里发表了很好的博客 - http://otaqui.com/blog/1618/how-to-fix-error-emfile-too-many-open-files-from-yeoman-and-npm/ 我更新了平均常见问题解答 https://github.com/linnovate/mean/wiki/Faq