Closed zzzh closed 1 year ago
It says: Error [ERR_REQUIRE_ESM]: require() of ES Module /home/zhu/node_modules/@noble/secp256k1/index.js from /home/zhu/ts1/ecdh.js not supported.
Node.js version: v18.17.1 tsc version: v5.2.2 tsconfig.json comes from tsc --init
Any ideas?
You are doing require (commonjs), while the package only supports import (esm).
require
import
If you want to use commonjs, switch to https://github.com/paulmillr/noble-curves
It says: Error [ERR_REQUIRE_ESM]: require() of ES Module /home/zhu/node_modules/@noble/secp256k1/index.js from /home/zhu/ts1/ecdh.js not supported.
Node.js version: v18.17.1 tsc version: v5.2.2 tsconfig.json comes from tsc --init
Any ideas?