简体   繁体   English

找不到个人npm模块

[英]Cannot find personal npm module

I've got a personal node.js app (unicorn-deposit-lobby) which I'm trying to use as an npm dependency in another project. 我有一个个人的node.js应用程序(unicorn-deposit-lobby),正在尝试将其用作另一个项目中的npm依赖项。 I've got it in my package.json, have done an npm install and can see it when I execute npm list however when I run it I get the following error: 我已经在package.json中获取了它,完成了npm安装并在执行npm list时可以看到它,但是当我运行它时,出现以下错误:

ERROR: Cannot find module 'unicorn-deposit-lobby'
firefox
at Function.Module._resolveFilename (module.js:455:15)
at Function.Module._load (module.js:403:25)
at Module.require (module.js:483:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/sam.eeles/git/tempWebdriverIo/test/specs/desktop/test.js:1:87)
at Module._compile (module.js:556:32)
at Object.Module._extensions..js (module.js:565:10)
at Module.load (module.js:473:32)
at tryModuleLoad (module.js:432:12)
at Function.Module._load (module.js:424:3)

Could anyone help me, I can't understand why it can't find my module? 谁能帮我,我不明白为什么找不到我的模块?

Cheers 干杯

Verify that your main section in packages.json points correctly to the module entry point. 验证packages.json中的主要部分是否正确指向模块入口点。 Or use local path in require like 或在require之类使用本地路径

require('./moddir')

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM