Set up a node.js project + sqlite3 without npm

Hi,

I use ubuntu and I have node.js and sqlite3 installed on my machine. I can work with it in the terminal. On the node.js webpage there is some code that you can use to set up a simple server without npm. Just copy, paste and it works. (About | Node.js) But I cannot require sqlite3 though I can see it is installed. Is there a way to get them to talk to each other without npm ? Is there some documentation out there that can help me do this? All the docs I find assume you use npm. The same for express.js. I cannot see a download button on the webpage.
A package json file is that intrinsically linked to npm? Does one always need a package manager? (there’s also yarn and brew and pip…) Where could I learn that? I would like to know what a package manager actually does on my machine and understand it better.
Thanks and greets,
Karin

You need to use npm or yarn to install the dependencies for your node.js app. You can’t install sqlite3 with Ubuntu and then require it with node.js. A package.json file is related to node.js so it is linked to npm but yarn also uses it.

Brew is a package manger for MacOS. It’s similar to apt on Ubuntu. They are both OS level package managers.

pip is Python’s package manager. Basically each language has it’s own package manager…as far as I know anyhow.

You can build applications without a package manager but then you’d have to code everything yourself and that would be an immense amount of work. Using packages generally means a faster, easier, and more robust solution.

Have you tried the tutorials for node on FCC? https://www.freecodecamp.org/learn/apis-and-microservices/

1 Like

thank you for your answer. it is what i suspected.
i’ve done the microservice projects and i still have to start the last one for the quality assurance certificate. i just feel a little uncomfortable to have to use npm all the time. once you start stacking up the projects you delete all the node js files to install them again when you need them just to save disc space. so you use npm again and again. it makes me feel kinda dependent and that’s an uncomfortable feeling. of course this is so subjective because i depend on so much code that’s out there. i’ve never felt dependent of jquery. but then i could manage without jquery if i really had to and that felt good. it didn’t make me like jquery any less and npm is an awesome inititiative. it has made so much possible. it’s this nagging feeling in the back of my head (people at home do call me the queen of catastrophe, i’m the original pessimist).

thanks and greets,
Karin

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.