Invalid Argument Type error when trying to run a .js file









up vote
0
down vote

favorite












I'm trying to run an app.js file with the command node app.js and the console is returning this error:



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:UsersAristophanesweb3_examplesapp.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)


Could anyone enlighten me as to how I could fix this error? Obviously it's something to do with an incorrect argument but I don't really know where to be looking.










share|improve this question





















  • The error message is pretty clear. The parameter is of wrong type, undefined in this case, so you should debug your code to find out why it is not initialized. It should be at app.js line 14.
    – nikos fotiadis
    Nov 10 at 16:28















up vote
0
down vote

favorite












I'm trying to run an app.js file with the command node app.js and the console is returning this error:



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:UsersAristophanesweb3_examplesapp.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)


Could anyone enlighten me as to how I could fix this error? Obviously it's something to do with an incorrect argument but I don't really know where to be looking.










share|improve this question





















  • The error message is pretty clear. The parameter is of wrong type, undefined in this case, so you should debug your code to find out why it is not initialized. It should be at app.js line 14.
    – nikos fotiadis
    Nov 10 at 16:28













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I'm trying to run an app.js file with the command node app.js and the console is returning this error:



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:UsersAristophanesweb3_examplesapp.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)


Could anyone enlighten me as to how I could fix this error? Obviously it's something to do with an incorrect argument but I don't really know where to be looking.










share|improve this question













I'm trying to run an app.js file with the command node app.js and the console is returning this error:



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:UsersAristophanesweb3_examplesapp.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)


Could anyone enlighten me as to how I could fix this error? Obviously it's something to do with an incorrect argument but I don't really know where to be looking.







node.js buffer ethereum web3






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 10 at 15:47









Aristophanes

237




237











  • The error message is pretty clear. The parameter is of wrong type, undefined in this case, so you should debug your code to find out why it is not initialized. It should be at app.js line 14.
    – nikos fotiadis
    Nov 10 at 16:28

















  • The error message is pretty clear. The parameter is of wrong type, undefined in this case, so you should debug your code to find out why it is not initialized. It should be at app.js line 14.
    – nikos fotiadis
    Nov 10 at 16:28
















The error message is pretty clear. The parameter is of wrong type, undefined in this case, so you should debug your code to find out why it is not initialized. It should be at app.js line 14.
– nikos fotiadis
Nov 10 at 16:28





The error message is pretty clear. The parameter is of wrong type, undefined in this case, so you should debug your code to find out why it is not initialized. It should be at app.js line 14.
– nikos fotiadis
Nov 10 at 16:28













1 Answer
1






active

oldest

votes

















up vote
0
down vote













You should look at app.js, line 14, col 28






share|improve this answer








New contributor




gkont is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

















  • What does 'col' refer to in this case?
    – Aristophanes
    Nov 10 at 16:08










  • That is for column.
    – gkont
    Nov 10 at 16:17










  • OK but there is no column in line 14 of app.js
    – Aristophanes
    Nov 10 at 16:19










  • What is in line 14? Can you post it?
    – gkont
    Nov 10 at 16:21










  • const privateKey1 = Buffer.from(process.env.PRIVATE_KEY_1, 'hex')
    – Aristophanes
    Nov 10 at 16:28










Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240596%2finvalid-argument-type-error-when-trying-to-run-a-js-file%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
0
down vote













You should look at app.js, line 14, col 28






share|improve this answer








New contributor




gkont is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

















  • What does 'col' refer to in this case?
    – Aristophanes
    Nov 10 at 16:08










  • That is for column.
    – gkont
    Nov 10 at 16:17










  • OK but there is no column in line 14 of app.js
    – Aristophanes
    Nov 10 at 16:19










  • What is in line 14? Can you post it?
    – gkont
    Nov 10 at 16:21










  • const privateKey1 = Buffer.from(process.env.PRIVATE_KEY_1, 'hex')
    – Aristophanes
    Nov 10 at 16:28














up vote
0
down vote













You should look at app.js, line 14, col 28






share|improve this answer








New contributor




gkont is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

















  • What does 'col' refer to in this case?
    – Aristophanes
    Nov 10 at 16:08










  • That is for column.
    – gkont
    Nov 10 at 16:17










  • OK but there is no column in line 14 of app.js
    – Aristophanes
    Nov 10 at 16:19










  • What is in line 14? Can you post it?
    – gkont
    Nov 10 at 16:21










  • const privateKey1 = Buffer.from(process.env.PRIVATE_KEY_1, 'hex')
    – Aristophanes
    Nov 10 at 16:28












up vote
0
down vote










up vote
0
down vote









You should look at app.js, line 14, col 28






share|improve this answer








New contributor




gkont is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









You should look at app.js, line 14, col 28







share|improve this answer








New contributor




gkont is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this answer



share|improve this answer






New contributor




gkont is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









answered Nov 10 at 15:59









gkont

1039




1039




New contributor




gkont is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





gkont is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






gkont is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











  • What does 'col' refer to in this case?
    – Aristophanes
    Nov 10 at 16:08










  • That is for column.
    – gkont
    Nov 10 at 16:17










  • OK but there is no column in line 14 of app.js
    – Aristophanes
    Nov 10 at 16:19










  • What is in line 14? Can you post it?
    – gkont
    Nov 10 at 16:21










  • const privateKey1 = Buffer.from(process.env.PRIVATE_KEY_1, 'hex')
    – Aristophanes
    Nov 10 at 16:28
















  • What does 'col' refer to in this case?
    – Aristophanes
    Nov 10 at 16:08










  • That is for column.
    – gkont
    Nov 10 at 16:17










  • OK but there is no column in line 14 of app.js
    – Aristophanes
    Nov 10 at 16:19










  • What is in line 14? Can you post it?
    – gkont
    Nov 10 at 16:21










  • const privateKey1 = Buffer.from(process.env.PRIVATE_KEY_1, 'hex')
    – Aristophanes
    Nov 10 at 16:28















What does 'col' refer to in this case?
– Aristophanes
Nov 10 at 16:08




What does 'col' refer to in this case?
– Aristophanes
Nov 10 at 16:08












That is for column.
– gkont
Nov 10 at 16:17




That is for column.
– gkont
Nov 10 at 16:17












OK but there is no column in line 14 of app.js
– Aristophanes
Nov 10 at 16:19




OK but there is no column in line 14 of app.js
– Aristophanes
Nov 10 at 16:19












What is in line 14? Can you post it?
– gkont
Nov 10 at 16:21




What is in line 14? Can you post it?
– gkont
Nov 10 at 16:21












const privateKey1 = Buffer.from(process.env.PRIVATE_KEY_1, 'hex')
– Aristophanes
Nov 10 at 16:28




const privateKey1 = Buffer.from(process.env.PRIVATE_KEY_1, 'hex')
– Aristophanes
Nov 10 at 16:28

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53240596%2finvalid-argument-type-error-when-trying-to-run-a-js-file%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

政党

天津地下鉄3号線