TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string
at assertPath (path.js:39:11)
at Object.join (path.js:1218:7)
at Object.readLogLines (/Users/santhoshdc/.nvm/versions/node/v9.8.0/lib/node_modules/@google-cloud/functions-emulator/src/emulator/logs.js:33:39)
at Controller.getLogs (/Users/santhoshdc/.nvm/versions/node/v9.8.0/lib/node_modules/@google-cloud/functions-emulator/src/cli/controller.js:462:10)
at Object.exports.handler (/Users/santhoshdc/.nvm/versions/node/v9.8.0/lib/node_modules/@google-cloud/functions-emulator/src/cli/commands/logs/read.js:58:14)
at Object.runCommand (/Users/santhoshdc/.nvm/versions/node/v9.8.0/lib/node_modules/@google-cloud/functions-emulator/node_modules/yargs/lib/command.js:235:44)
at Object.parseArgs [as _parseArgs] (/Users/santhoshdc/.nvm/versions/node/v9.8.0/lib/node_modules/@google-cloud/functions-emulator/node_modules/yargs/yargs.js:1014:30)
at Object.runCommand (/Users/santhoshdc/.nvm/versions/node/v9.8.0/lib/node_modules/@google-cloud/functions-emulator/node_modules/yargs/lib/command.js:195:96)
at Object.parseArgs [as _parseArgs] (/Users/santhoshdc/.nvm/versions/node/v9.8.0/lib/node_modules/@google-cloud/functions-emulator/node_modules/yargs/yargs.js:1014:30)
at Object.parse (/Users/santhoshdc/.nvm/versions/node/v9.8.0/lib/node_modules/@google-cloud/functions-emulator/node_modules/yargs/yargs.js:542:25)
/**
* Writes lines from the Emulator log file in FIFO order.
* Lines are taken from the end of the file according to the limit argument.
* That is, when limit is 10 will return the last (most recent) 10 lines from
* the log (or fewer if there are fewer than 10 lines in the log), in the order
* they were written to the log.
*
* @param {integer} limit The maximum number of lines to write
*/
getLogs (limit) {
if (!limit) {
limit = 20;
}
logs.readLogLines(this.config.logFile, limit, (val) => {
this.write(val);
});
}
// what does yargs look like after the buidler is run?
let innerArgv = parsed.argv
let innerYargs = null
let positionalMap = {}
if (command) {
currentContext.commands.push(command)
currentContext.fullCommands.push(commandHandler.original)
}
if (typeof commandHandler.builder === 'function') {
// a function can be provided, which builds
// up a yargs chain and possibly returns it.
innerYargs = commandHandler.builder(yargs.reset(parsed.aliases))
// if the builder function did not yet parse argv with reset yargs
// and did not explicitly set a usage() string, then apply the
// original command string as usage() for consistent behavior with
// options object below.
if (yargs.parsed === false) {
if (shouldUpdateUsage(yargs)) {
yargs.getUsageInstance().usage(
usageFromParentCommandsCommandHandler(parentCommands, commandHandler),
commandHandler.description
)
}
innerArgv = innerYargs ? innerYargs._parseArgs(null, null, true, commandIndex) : yargs._parseArgs(null, null, true, commandIndex)
} else {
innerArgv = yargs.parsed.argv
}
const handlerKeys = command.getCommands()
const skipDefaultCommand = argv[helpOpt] && (handlerKeys.length > 1 || handlerKeys[0] !== '$0')
if (argv._.length) {
if (handlerKeys.length) {
let firstUnknownCommand
for (let i = (commandIndex || 0), cmd; argv._[i] !== undefined; i++) {
cmd = String(argv._[i])
if (~handlerKeys.indexOf(cmd) && cmd !== completionCommand) {
setPlaceholderKeys(argv)
// commands are executed using a recursive algorithm that executes
// the deepest command first; we keep track of the position in the
// argv._ array that is currently being executed.
return command.runCommand(cmd, self, parsed, i + 1)
} else if (!firstUnknownCommand && cmd !== completionCommand) {
firstUnknownCommand = cmd
break
}
}
I built it local and deployed it locally
py-cloud-fn handle_http http -f function.py --python_version 3.5
py-cloud-fn handle_http http --python_version 3.5 -p -f function.py && cd cloudfn/target && npm install && functions deploy handle_http --trigger-http && cd ../..
When I hit the url with
POSTMAN
I get this
I have no idea
/Users/santhoshdc/.nvm/versions/node/v9.8.0/lib/node_modules/@google-cloud/functions-emulator/src/emulator/logs.js
/Users/santhoshdc/.nvm/versions/node/v9.8.0/lib/node_modules/@google-cloud/functions-emulator/src/cli/controller.js
/Users/santhoshdc/.nvm/versions/node/v9.8.0/lib/node_modules/@google-cloud/functions-emulator/src/cli/commands/logs/read.js
/Users/santhoshdc/.nvm/versions/node/v9.8.0/lib/node_modules/@google-cloud/functions-emulator/node_modules/yargs/lib/command.js
/Users/santhoshdc/.nvm/versions/node/v9.8.0/lib/node_modules/@google-cloud/functions-emulator/node_modules/yargs/lib/command.js
/Users/santhoshdc/.nvm/versions/node/v9.8.0/lib/node_modules/@google-cloud/functions-emulator/node_modules/yargs/yargs.js
/Users/santhoshdc/.nvm/versions/node/v9.8.0/lib/node_modules/@google-cloud/functions-emulator/node_modules/yargs/yargs.js:542:25
where did I got wrong????