Reference error, $ is undefined even with jQuery installed

#1

Hello
I’m trying to use jQuery to use for HTTP requests, I've installed jQuery in packages.json but when I use the dollar sign (.get), it errors saying $ is undefined. I didn’t really find anyone having the same problem.
Project link: https://glitch.com/~omya-afdas

#2

uhm you defined your variable with jQuery not $ and also i don’t think it is a good idea to use jquery in node.js, there are much better and smaller packages for that (e.g. node-fetch).

#3

When I define as require("jquery"), it still errors but saying that .get is not a valid function.

#5

I tried using node-fetch and now it works, thanks.

2 Likes