我有一个node应用程序,其中package.json
文件声明了我的依赖关系。
我运行npm install
将这些依赖项安装到本地的node_modules
文件夹中,当我运行我的应用程序时,一切都很顺利。
问题在于当我尝试通过启动node REPL来扩展一些新功能时:
$ node
> require('hubot');
Error: Cannot find module 'hubot'
在REPL中,它似乎不知道查找
node_modules
内部的内容。这是预期行为吗?还是hubot有问题?
node_modules
的父文件夹)运行它。 - rdrey