Closed jigsnptel closed 2 years ago
screenshot after running index.js file. showing unexpected token in file nodechannel.cjs at line 92. pls help. not going further without solving this problem
Try changing the value 10_000 to 10000 and see if that works.
hi, thank you, but not able to open nodechannel.js
it worked, thank you very much.
glad it worked!!
Description
I installed hedera-js-sdk on my machine before few months. it was working fine. suddenly it is giving error in the "require" stmt, the error is "unexpected or invalid token". I tried all the options like, installing hedera js sdk again, removed node_modules and again used npm install, created new file. nothing works. I tried "import" option also. but it gives "unexpected token {" error. pls help. I also tried "experimental modules" option. nothing works.
Steps to reproduce
const { Client } = require("@hashgraph/sdk"); require("dotenv").config();
async function main() {
} main();
Additional context
C:\Program Files\nodejs\node.exe .\index.js Uncaught SyntaxError: Invalid or unexpected token Process exited with code 1 package.json file
{ "name": "hello-hedera-js-sdk", "version": "1.0.0", "description": "", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, "author": "", "license": "ISC", "dependencies": { "@hashgraph/sdk": "^2.7.0", "dotenv": "^14.2.0" } }
"C:\Users\Vipul\hello-hedera-js-sdk\index.js" file path
Hedera network
testnet
Version
v2.7.0
Operating system
Windows