Cannot find module 'node:crypto'

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'
  ]
}
1 Like

@delarosaneilwendell Your issue has been forwarded to our team and we will get back with further updates

1 Like

@delarosaneilwendell Did you run npm i before running start?

@maharshi Yes I did. I made sure that all the necessary modules are installed before I tried running it.

1 Like

@delarosaneilwendell May I know the version of Node you are using? You can get this by running node -v on the terminal.

We have not received any response from you . Do you still need assistance?

Do join our upcoming community call - Web3Auth Community Call #4 · Zoom · Luma