我在一个应用程序中实现了一个npm模块(称为wrench),我总是在本地测试。这总是没有问题的。然后我尝试在我的服务器上安装wrench。
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
这里有什么我没注意到的吗?
谢谢,
Elias