尝试 运行 mocha 测试时获得 "Cannot find module 'request-json/node_modules/request'"

Getting "Cannot find module 'request-json/node_modules/request'" while trying to run mocha tests

我正在尝试 运行 mocha 测试如下:

mocha test\myTest.js

但是我得到以下错误:

module.js:340
throw err;
^

Error: Cannot find module 'request-json/node_modules/request'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:289:25)
at Module.require (module.js:366:17)
at require (module.js:385:17)....

我明确尝试添加 npm 依赖项 requestrequest-json 但它没有帮助。我错过了什么吗?

出于某种原因,最新版本的 npm 模块 request-json 没有安装它所需的依赖项。我在此模块中手动执行了 npm install 并解决了问题。