1

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();
});

参考链接:如何修复:“路径”参数必须是字符串类型。运行'vue add vuetify'时收到类型未定义'

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

1 回答 1

1

看起来你拼错了“protofile”或“portofile”,这就是触发错误的参数。

于 2019-08-11T14:02:01.863 回答