Node.js [ERR“U INVALID”ARG“U TYPE]:该;路径“;参数的类型必须为字符串。接收类型未定义,Mountebank
每当使用^2.0.0版本的mountebank运行mountebank服务器时,npm开始给我错误信息Node.js [ERR“U INVALID”ARG“U TYPE]:该;路径“;参数的类型必须为字符串。接收类型未定义,Mountebank,node.js,mountebank,Node.js,Mountebank,每当使用^2.0.0版本的mountebank运行mountebank服务器时,npm开始给我错误信息 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
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)
Index.js
参考链接:
看起来您错放了“protofile”或“portofile”,这就是触发错误的参数
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();
});
npm uninstall -g @vue/cli
npm install -g @vue/cli