【发布时间】:2011-04-08 10:53:32
【问题描述】:
我在一个我总是在本地测试的应用程序中实现了一个 npm 模块(称为扳手)。这总是没有问题的。然后我试图在我的服务器上安装扳手。
npm install wrench 确实按预期工作,但一旦涉及require("wrench"),我收到以下错误:
> require("wrench")
Error: Cannot find module 'wrench'
at Function._resolveFilename (module.js:320:11)
at Function._load (module.js:266:25)
at require (module.js:348:19)
at [object Context]:1:1
at Interface.<anonymous> (repl.js:171:22)
at Interface.emit (events.js:64:17)
at Interface._onLine (readline.js:153:10)
at Interface._line (readline.js:408:8)
at Interface._ttyWrite (readline.js:585:14)
at ReadStream.<anonymous> (readline.js:73:12)
如果我运行npm ls 我可以看到
wrench@0.1.0
这里有什么我遗漏的吗?
谢谢,
埃利亚斯
【问题讨论】:
-
你使用哪个版本的 npm 和 node.js?