apollographql / fullstack-tutorial

🚀 The Apollo platform tutorial app
https://www.apollographql.com/docs/tutorial/introduction.html
MIT License
1.24k stars 839 forks source link

Can't install sqlite3 #198

Open hjrobinson opened 3 years ago

hjrobinson commented 3 years ago

I apologize if this issue has already been addressed but I can't install sqlite3. So I've tried to fix this on my own to no avail by changing node versions and installing different versions of sqlite3. Any advice is appreciated. I have Visual Studio code installed and I use Windows 8. I'm not sure if that matters.

abiola-ajibola commented 3 years ago

Update it to version 5.0.0

See https://github.com/mapbox/node-sqlite3/issues/1430

hjrobinson commented 3 years ago

Yes you are correct I needed to use this version. By the way I erred in my statement above. I don't know if having VSCode installed matters. Also because I am using Windows 8 I needed the appropriate sdk which is not available with the latest VSCommunity (it seems this one only comes with the sdk for Windows 10). Altogether it took me 12 hours to figure out how to successfully install sqlite3. So here's what I did.

  1. Fresh install of node making sure you check the box for having Chocolatey, Python, and all the extra stuff installed.

  2. Download VSCommunity 2015 from here: https://my.visualstudio.com/Downloads/Featured?mkt=en-us

I did check some boxes for installing extra stuff with VSCommunity 2015. I can't remember what boxes those were and I don't know if that part mattered.

  1. Then install sqlite3@5.0.0 per your advice above (either update the package.json or just run the command): npm install sqlite3@5.0.0

So if anyone else is living in the past with Windows 8 this should point you in the right direction for completing the install. Good luck!

OctavioBR commented 3 years ago

Since the pre-built binaries are unavailable (403) from https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v5.0.1/napi-v6-linux-x64.tar.gz, node-pre-gyp will actually require python to be installed on your machine to successfully install sqlite

abiola-ajibola commented 3 years ago

Oh, I see, I do not have Python installed on my machine, so I used another version of SQLite.

Solrac23 commented 3 years ago

I have Python on machine, but it still doesn't work. my OS is POP_OS.

hjrobinson commented 3 years ago

I just wanted to add here that I was installing the packages for the final version of the server and even after updating the package.json to install 5.0.0 it automatically installed sqlite3 version 5.0.1 resulting in an installation error. When I ran npm install sqlite3@5.0.0 sqlite3 installed correctly.

abiola-ajibola commented 3 years ago

I just wanted to add here that I was installing the packages for the final version of the server and even after updating the package.json to install 5.0.0 it automatically installed sqlite3 version 5.0.1 resulting in an installation error. When I ran npm install sqlite3@5.0.0 sqlite3 installed correctly.

You can use *5.0.0 interest of ^5.0.0 or ~5.0.0 in your package.json

hjrobinson commented 3 years ago

I know these things are kind of obvious but if you have a package-lock.json leftover from a failed install you will want to delete that before making your next attempt and it may be a good idea to run your installs as admin in the Windows terminal.

jlpg81 commented 3 years ago

Guys if youre sure that updating sqlite3 to version 5 wont break anything, Id suggest we update the dependencies in the package.json. This tutorial is supposed to help people get into apollo grapqhql, having an error appear with the first command can drive people away.