【问题标题】:[ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined, Mountebank[ERR_INVALID_ARG_TYPE]:“路径”参数必须是字符串类型。接收类型未定义,Mountebank
【发布时间】:2019-12-14 16:38:09
【问题描述】:

npm start 使用 ^2.0.0 版本的 mountebank 运行 mountebank 服务器时给我错误

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined
    at validateString (internal/validators.js:125:11)
    at Object.join (path.js:1147:7)
    at loadCustomProtocols (./node_modules/mountebank/src/mountebank.js:102:25)
    at loadProtocols (./mountebank/node_modules/mountebank/src/mountebank.js:134:27)
    at Object.create (./mountebank/node_modules/mountebank/src/mountebank.js:169:21)

索引.js

const mb = require('mountebank')
const settings = require('./settings');
const helloService = require('./hello-service')

const mbServerInstance =  mb.create({
        port: settings.ports,
        pidfile: '../mb.pid',
        logfile: '../mb.log',
        portofile: '../protofile.json',
        ipWhitelist: ['*']
    });


mbServerInstance.then(function() {
    helloService.addService();
});

参考链接:How to fix: 'The "path" argument must be of type string. Received type undefined' when running 'vue add vuetify'

npm uninstall -g @vue/cli
npm install -g @vue/cli

【问题讨论】:

    标签: node.js mountebank


    【解决方案1】:

    您似乎拼错了“protofile”或“portofile”,这是触发错误的参数。

    【讨论】:

      猜你喜欢
      • 2020-09-21
      • 2021-09-08
      • 2020-12-30
      • 2022-01-12
      • 2021-01-22
      • 1970-01-01
      • 2019-05-13
      • 2020-12-22
      相关资源
      最近更新 更多