Hi There,
I have been tying to run “node stats.js” but keep getting an error message,
I have already successfully executed the followings in the “stats” directory, “npm i moralis” and “npm i fs”.
All steps before this also did not gave me any problems.
but some how no matter what I have tried I still get the “throw err” (see below) when I try to run “node stats.js” after saving “stats.js”.
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module ‘moralis/node’
Require stack:
- C:\Users\cryra\Whalewatcher-Web3\stats\stats.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object. (C:\Users\cryra\Whalewatcher-Web3\stats\stats.js:1:17)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions…js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) {
code: ‘MODULE_NOT_FOUND’,
requireStack: [ ‘C:\Users\cryra\Whalewatcher-Web3\stats\stats.js’ ]
}
“stats” directory Package.json below
{
“name”: “stats”,
“version”: “1.0.0”,
“description”: “”,
“main”: “index.js”,
“scripts”: {
"test": "echo \"Error: no test specified\" && exit 1"
},
“author”: “”,
“license”: “ISC”,
“dependencies”: {
"fs": "^0.0.1-security",
"moralis": "^2.0.1"
}
}
Your help very much appreciated. Thank You.
Windows 11
npm 8.3.0