P5.js in packages.json not working


So in this package I’ve installed p5.js and p5.play in packages.json. Currently the p5 methods (like “ellipse”) aren’t working, as you can see. Is there anything I need to do besides put the modules in packages.json to make them work?

I know I can just include the link in the html, but then what’s the point of packages.json?


Adding the link in your html will make it so that you can use it in your frontend code only. So you’ll be able to access it from your index.html, and js files in your public folder.

But for many packages (like Express), you need to run them on your server (ie in your server.js) – that’s what packages.json is for.


Thank you! I see how it works now.