[SOLVED] Cant connect to moalis/node

hi thanks for taking a look if you can help me figure out what i did wrong that would be great.

im pulling this error when i run the script

Error: Cannot find module ‘moralis/node’
Require stack:

  • C:\Users\brans\Documents\2d game\Pixel people\index.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\brans\Documents\2d game\Pixel people/index.js:2:17)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Module._compile (C:\Users\brans.atom\packages\script\node_modules\pirates\lib\index.js:136:24)
    at Module._extensions…js (node:internal/modules/cjs/loader:1153:10)
    at Object.newLoader [as .js] (C:\Users\brans.atom\packages\script\node_modules\pirates\lib\index.js:141:7)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [ ‘C:\Users\brans\Documents\2d game\Pixel people\index.js’ ]
    }

maybe you are trying to import Moralis SDK this way:

    const  Moralis = require('moralis/node')

you have to install it first in order to make that work
usually I use: npm install --save moralis

1 Like

ah ok i see thank you now it gave me this sorry im still new to the world and debugging is still new to me.

Error: Cannot find module ‘canvas’
Require stack:

  • C:\Users\brans\Documents\2d game\Pixel people\index.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\brans\Documents\2d game\Pixel people/index.js:5:37)
    at Module._compile (node:internal/modules/cjs/loader:1101:14)
    at Module._compile (C:\Users\brans.atom\packages\script\node_modules\pirates\lib\index.js:136:24)
    at Module._extensions…js (node:internal/modules/cjs/loader:1153:10)
    at Object.newLoader [as .js] (C:\Users\brans.atom\packages\script\node_modules\pirates\lib\index.js:141:7)
    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)
    at Object. (C:\Users\brans.atom\packages\script\node_modules@babel\node\lib_babel-node.js:176:21)
    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) {
    code: ‘MODULE_NOT_FOUND’,
    requireStack: [ ‘C:\Users\brans\Documents\2d game\Pixel people\index.js’ ]
    }

now you may need to install some module named canvas

thank you that helped