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.
node.js buffer ethereum web3
add a comment |
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.
node.js buffer ethereum web3
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 atapp.js line 14
.
– nikos fotiadis
Nov 10 at 16:28
add a comment |
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.
node.js buffer ethereum web3
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
node.js buffer ethereum web3
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 atapp.js line 14
.
– nikos fotiadis
Nov 10 at 16:28
add a comment |
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 atapp.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
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
You should look at app.js, line 14, col 28
New contributor
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
|
show 1 more comment
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
New contributor
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
|
show 1 more comment
up vote
0
down vote
You should look at app.js, line 14, col 28
New contributor
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
|
show 1 more comment
up vote
0
down vote
up vote
0
down vote
You should look at app.js, line 14, col 28
New contributor
You should look at app.js, line 14, col 28
New contributor
New contributor
answered Nov 10 at 15:59
gkont
1039
1039
New contributor
New contributor
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
|
show 1 more comment
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
|
show 1 more comment
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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 atapp.js line 14
.– nikos fotiadis
Nov 10 at 16:28