Ask coding questions

← Back to all posts
NodeJS Repl.it Database Error [CLOSED]
lightningrock

When I try to use repl.it's database in NodeJS, which I import on lines 8 and 9, it says the @replit/database modules wasn't found.
Error:

Voters
itsYAHYAY
lightningrock
Comments
hotnewtop
RYANTADIPARTHI

uh, everything seems to be working.

lightningrock

I've commented it out, because otherwise it won't run. @RYANTADIPARTHI

RYANTADIPARTHI

@lightningrock well, one problem is the import.import repl db like this.

not exactly like that, but in node js, import it properly. Not /

lightningrock

But replit says to import it like this:

Anyways how do I do it without the /?

@RYANTADIPARTHI

Pankak

@RYANTADIPARTHI thats python, he's using nodes

RYANTADIPARTHI

@lightningrock maybe this.

Pankak

@lightningrock I am fairly certain this is a bug unless you did something super wacky to mess up the file structures

lightningrock

@Pankak @RYANTADIPARTHI It's working now. For some reason when I did require("@replit/database"), it didn't automatically install the package. I've installed it manually and it works now.

Pankak

@lightningrock alright, yeah you want to learn to manually install, repl is whacky sometimes

RYANTADIPARTHI

@lightningrock ok good.

Coder100

you don't install packages?
ew

ctrl+shift+s
and then
npm i @replit/database

their upm rarely detects packages correctly.

bigrice303

@Coder100 yes it worked

Coder100

amazing @bigrice303

lightningrock

@bigrice303 @Coder100
why are you replying to this post after 5 months lol

bigrice303

just saw it
@lightningrock

RaphaelMorgan

@Coder100 you know there was probably a more helpful way to say 'oh you forgot to install the package and that's why it's not working' than 'you don't install packages? ew'