尝试运行.js文件时出现无效的参数类型错误

时间:2018-11-10 15:47:06

标签: node.js buffer ethereum web3

我正在尝试使用命令node app.js运行 app.js 文件,控制台将返回此错误:

buffer.js:200
    throw new ERR_INVALID_ARG_TYPE(
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type undefined
    at Function.from (buffer.js:200:11)
    at Object.<anonymous> (C:\Users\Aristophanes\web3_examples\app.js:14:28)
    at Module._compile (internal/modules/cjs/loader.js:707:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
    at Module.load (internal/modules/cjs/loader.js:605:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
    at Function.Module._load (internal/modules/cjs/loader.js:536:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:760:12)
    at startup (internal/bootstrap/node.js:308:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:878:3)

有人能启发我如何解决此错误吗?显然这与不正确的参数有关,但我真的不知道要去哪里。

1 个答案:

答案 0 :(得分:0)

您应该查看app.js,第14行,第28行,