yerofey / cryptowallet-cli

CW: a crypto wallet generator CLI tool for a lot of blockchains (Bitcoin, Ethereum, Solana, TON and many others)
https://www.npmjs.com/package/@yerofey/cryptowallet-cli
MIT License
104 stars 46 forks source link

TronWeb.node.js not supported #32

Closed Demontager closed 9 months ago

Demontager commented 10 months ago

Hello, i have tried 3 node js versions: lts, the latest and 19.0.0 and none compatible to run cw with the following error. ` $ cw -l node:internal/process/esm_loader:108 internalBinding('errors').triggerUncaughtException( ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /home/dem/node_modules/@noble/secp256k1/index.js from /home/dem/.nvm/versions/node/v19.0.0/lib/node_modules/@yerofey/cryptowallet-cli/node_modules/tronweb/dist/TronWeb.node.js not supported. Instead change the require of index.js in /home/dem/.nvm/versions/node/v19.0.0/lib/node_modules/@yerofey/cryptowallet-cli/node_modules/tronweb/dist/TronWeb.node.js to a dynamic import() which is available in all CommonJS modules. at /home/dem/.nvm/versions/node/v19.0.0/lib/node_modules/@yerofey/cryptowallet-cli/node_modules/tronweb/dist/TronWeb.node.js:1:296510 at /home/dem/.nvm/versions/node/v19.0.0/lib/node_modules/@yerofey/cryptowallet-cli/node_modules/tronweb/dist/TronWeb.node.js:1:694217 at Object. (/home/dem/.nvm/versions/node/v19.0.0/lib/node_modules/@yerofey/cryptowallet-cli/node_modules/tronweb/dist/TronWeb.node.js:1:694246) at async Promise.all (index 0) { code: 'ERR_REQUIRE_ESM' }

Node.js v19.0.0

`

yerofey commented 9 months ago

Hi @Demontager Apology for delayed response, I just tried 3 different node versions: 18, 19, 20 - for all of them the CW package is working. I was using Ubuntu 22 machine. Can you try the latest package version and provide more details on your setup please.

Screenshot 2023-12-01 at 14 09 27 Screenshot 2023-12-01 at 14 09 03 Screenshot 2023-12-01 at 14 09 13
Demontager commented 9 months ago

Yes, now it works. Tried to run on the same system - Mac OS Ventura 13.6. ` dem@MacBook12 ~ % npm i -g @yerofey/cryptowallet-cli

npm WARN deprecated @types/bech32@1.1.4: This is a stub types definition. bech32 provides its own type definitions, so you do not need this installed. npm WARN deprecated har-validator@5.1.5: this library is no longer supported npm WARN deprecated uuid@3.0.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated @ledgerhq/hw-transport-u2f@5.34.0: @ledgerhq/hw-transport-u2f is deprecated. Please use @ledgerhq/hw-transport-webusb or @ledgerhq/hw-transport-webhid. https://github.com/LedgerHQ/ledgerjs/blob/master/docs/migrate_webusb.md npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142 npm WARN deprecated text-encoding@0.7.0: no longer maintained

changed 461 packages in 1m

52 packages are looking for funding run npm fund for details npm notice npm notice New minor version of npm available! 10.1.0 -> 10.2.4 npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.2.4 npm notice Run npm install -g npm@10.2.4 to update! npm notice dem@MacBook12 ~ % npm install -g npm@10.2.4

added 1 package in 3s

28 packages are looking for funding run npm fund for details dem@MacBook12 ~ % node -v v20.9.0 dem@MacBook12 ~ % cw ✨ Done! Here is your brand new ERC-like wallet:

📄 transfer wink globe eagle worth finger gather hurt hub index gym unable 👛 0x01e08255A3E9Bd47302de64295846eFB60eb90E6 🔑 b4d4765522c04cf376d82131cdbcd36ec682f810e0d9b5fcc7662cdd8eb408d1

🆒 You can use this wallet in Ethereum, Binance Smart Chain, Polygon and few more networks (EVM compatible) ℹ️ You can import this wallet into MetaMask, Trust Wallet, Binance Chain Wallet and many other wallet apps 🙏 Consider supporting the project - see donation options with: cw --donate `

yerofey commented 9 months ago

@Demontager you are welcome