Please help, I’m having an error when I try to run the app using npm run start
as instructed from https://github.com/Web3Auth/web3auth-core-kit-examples/tree/main/node-sdk/node-backend-example.
The details of the error is as follows;
Error: Cannot find module 'node:crypto'
Require stack:
- /Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@noble/hashes/cryptoNode.js
- /Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@noble/hashes/utils.js
- /Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@noble/hashes/_sha2.js
- /Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@noble/hashes/sha256.js
- /Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@noble/curves/secp256k1.js
- /Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/ethereum-cryptography/secp256k1.js
- /Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@ethereumjs/util/dist/constants.js
- /Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@ethereumjs/util/dist/index.js
- /Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@toruslabs/base-controllers/dist/baseControllers.cjs.js
- /Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@web3auth/base-provider/dist/baseProvider.cjs.js
- /Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@web3auth/node-sdk/dist/Web3Auth.js
- /Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@web3auth/node-sdk/dist/index.js
- /Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/index.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
at Function.Module._load (node:internal/modules/cjs/loader:769:27)
at Module.require (node:internal/modules/cjs/loader:996:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (/Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@noble/hashes/cryptoNode.js:4:12)
at Module._compile (node:internal/modules/cjs/loader:1092:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
at Module.load (node:internal/modules/cjs/loader:972:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Module.require (node:internal/modules/cjs/loader:996:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@noble/hashes/cryptoNode.js',
'/Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@noble/hashes/utils.js',
'/Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@noble/hashes/_sha2.js',
'/Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@noble/hashes/sha256.js',
'/Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@noble/curves/secp256k1.js',
'/Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/ethereum-cryptography/secp256k1.js',
'/Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@ethereumjs/util/dist/constants.js',
'/Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@ethereumjs/util/dist/index.js',
'/Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@toruslabs/base-controllers/dist/baseControllers.cjs.js',
'/Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@web3auth/base-provider/dist/baseProvider.cjs.js',
'/Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@web3auth/node-sdk/dist/Web3Auth.js',
'/Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/node_modules/@web3auth/node-sdk/dist/index.js',
'/Users/niru/Documents/Sysplex/Projects/Hada-san/Shutendouji/src/web3_sample/backend/w3a-nodejs-example/index.js'
]
}