1

npm start Giving me error whenever running mountebank server with ^2.0.0 version of 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)

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

Reference link : 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
karan kural
  • 25
  • 1
  • 1
  • 5

1 Answers1

1

It looks like you mispelled "protofile" or "portofile", and that's the argument that's triggering the error.

bbyars
  • 406
  • 3
  • 3