Skip to content
Sign upLog in
Profile icon

hazel

@hazelpy
Repls
Community
hazelpy
hazelpy
shared a Post
3 years ago
1
TypeError: require(...) is not a function
When I attempt to use require() in a Nodejs repl, it throws the error in the title. What am I doing wrong?
Repl World
Node.js
eco27
eco27
require is not a function because you are trying to call the thing you required like a function example: a = require("a"); a() <- this might throw an error because a itself might not be a function, this is equivalent of putting require("a")() so the thing you are trying to require might not be a function3 years ago
hazelpy
hazelpy
shared a Post
3 years ago
4
I wrote a visualization for the bubble sort algorithm in Pygame, but since it was too boring, I added a forever-changing background that smoothly chan