【发布时间】:2014-04-04 10:51:49
【问题描述】:
我有一些代码在两个不同的服务器上运行,在尝试将其移至第三个服务器后,它正在轰炸,我这辈子都不明白为什么。特定模块是 node-memcached(由 3rd-Eden 提供),但由于它可以在多个其他位置工作,我不确定这是否相关。 3 台服务器之间的唯一区别是我尝试在这台新服务器上更新到节点 0.10,而其他两台服务器上的节点都为 0.6。
这是我看到的错误:
module.js:337
throw new Error("Cannot find module '" + request + "'");
^
Error: Cannot find module 'Memcached'
at Function._resolveFilename (module.js:337:11)
at Function._load (module.js:279:25)
at Module.require (module.js:359:17)
at require (module.js:375:17)
at Object.<anonymous> (/net/somepath/myproj/CCDataAccess.js:3:17)
at Module._compile (module.js:446:26)
at Object..js (module.js:464:10)
at Module.load (module.js:353:32)
at Function._load (module.js:311:12)
at Module.require (module.js:359:17)
我在项目中安装了 memcached,如下所示:
cd /net/somepath/myproj/
npm install memcached
在同一个目录上使用npm list,我可以看到它在那里列出
/net/somepath/myproj
├─┬ memcached@0.2.8
│ ├─┬ hashring@0.0.8
│ │ ├── bisection@0.0.3
│ │ └── simple-lru-cache@0.0.1
│ └─┬ jackpot@0.0.6
│ └── retry@0.6.0
memcached 的实际 require 语句嵌套在启动 js 深处大约 3 个文件,但实际调用是这样的:
var Memcached = require('Memcached');
在这一点上,我不确定接下来要尝试什么来完成这项工作。非常感谢任何建议、指导甚至解决方案!
【问题讨论】: