newman,postman 的 cli runner,找不到自定义记者

newman, postman's cli runner, can not find a custom reporter

当我 运行 newman 使用自定义报告器时,它找不到它,并且错误指出报告器应该安装在 newman 目录中。我在 windows 10。它被命名为 newman-reporter-csvconsole。 newman默认目录在哪里,给记者找找?

记者包index.js

function csvconsole (emitter, reporterOptions, collectionRunOptions) {
emitter.on('start',function (err, args) 
{ // on start of run, log to console
    console.log('running a collection...');
});

} module.exports = csvconsole;

然后我安装一个本地包

C:\Users<用户>\AppData\Roaming\npm\node_modules\newman\newman-reporter-csvconsole>npm init -w newman-reporter-csvconsole -S

C:\Users<用户>\AppData\Roaming\npm\node_modules\newman\newman-reporter-csvconsole>npm pack

C:\Users<用户>\AppData\Roaming\npm\node_modules\newman>npm install -S ./csvconsoleReporter/newman-reporter-csvconsole-1.0.0.tgz

包和包锁文件

C:\Users<用户>\AppData\Roaming\npm\node_modules\newman\package.json

“依赖项”:{ ... "newman-reporter-csvconsole": "file:newman-reporter-csvconsole", ...

C:\Users<用户>\AppData\Roaming\npm\node_modules\newman\package-lock.json

“依赖项”:{ ... "newman-reporter-csvconsole": "file:newman-reporter-csvconsole", ...

"newman-reporter-csvconsole": {
  "version": "1.0.0",
  "license": "ISC"
},

... “node_modules/newman-reporter-csvconsole”:{ “已解决”:“newman-reporter-csvconsole”, “link”:真 },
... “newman-reporter-csvconsole”:{ “版本”:“文件:newman-reporter-csvconsole” },

module.exports = function csvconsole (emitter, reporterOptions, collectionRunOptions) 
{
  // emitter is is an event emitter that triggers the following events: https://github.com/postmanlabs/newman#newmanrunevents
  // reporterOptions is an object of the reporter specific options. See usage examples below for more details.
  // collectionRunOptions is an object of all the collection run options:
  // https://github.com/postmanlabs/newman#newmanrunoptions-object--callback-function--run-eventemitter
  
  emitter.on('start',function (err, args) 
  { // on start of run, log to console
    console.log('running a collection...');
  });
}