Problem installing sqlite3

Hi, I’m working on the x-press-publishing project in the Building a persistent API module:

when I run ‘npm install’ to install the dependencies, I getting errors that point to a problem with sqlite3:

node-pre-gyp ERR! Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@10.16.3 (node-v64 ABI) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(undefined): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v3.1.13/node-v64-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for sqlite3@3.1.13 and node@10.16.3 (node-v64 ABI) (falling back to source compile with node-gyp)

node-pre-gyp ERR! stack at ChildProcess. (/Users/acandael/Tutorials/x-press-publishing/node_modules/sqlite3/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:198:13)
node-pre-gyp ERR! stack at maybeClose (internal/child_process.js:982:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
node-pre-gyp ERR! System Darwin 18.7.0
node-pre-gyp ERR! command “/Users/acandael/.nvm/versions/node/v10.16.3/bin/node” “/Users/acandael/Tutorials/x-press-publishing/node_modules/sqlite3/node_modules/.bin/node-pre-gyp” “install” “–fallback-to-build”
node-pre-gyp ERR! cwd /Users/acandael/Tutorials/x-press-publishing/node_modules/sqlite3
node-pre-gyp ERR! node -v v10.16.3
node-pre-gyp ERR! node-pre-gyp -v v0.6.38
node-pre-gyp ERR! not ok

I tried several things like changing my node version to v10.16.3 , but nothing seems to solve my problem.

Has someone experience with this issue? How can I fix it?

thanks for your help,

Anthony

2 Likes

The problem seems to be related to this:

node-pre-gyp install --fallback-to-build

1 Like

phew, after searching for 2 days for a fix, I finally solved the issue by rolling back to Node v9.11.1

5 Likes

Hey Anthony -

Thanks for your post, I had the exact same issue so this saved me a lot of time figuring out what was wrong. Codecademy should include some sort of warning on this.

Anyway, used a node version manager tool (here) that works perfectly and lets you dynamically change your node version to be used.

Jeroen

I have the same issue, i can’t believe that something such important is not warning anywhere… thank you guys

Hey Y’all,
I’m having the same issue with this project. Is anyone using a nvm for mac? If so, can you recommend a link for the nvm so i can install sqlite3?
Not sure I really understand how nvm and node live side by side on my cpu…
j

For Windows10 I had to uninstall node and installed again v9.11.1 from https://nodejs.org/en/download/releases/ and after npm install worked.

Instead of changing the node version, try to change the sqlite version in package.json:
for me

“sqlite3”: “^4.1.1”

worked perfectly (4.1.1 is the latest sqlite version on npmjs.com). After this, just run npm install again.

3 Likes

Thank you @patrick1238558746048!
That seems to have solved the problem very easily. How did you know to do this?

Thanks, again!

I read something on the internet that the problem is related to compatibility problems of node and sqlite so I thought about just using a newer version of sqlite instead of deinstalling node and downloading an earlier node version. Other codecademy-projects seem to already have a newer sqlite version included in package.json!

1 Like

Thanks for letting me know.

Can you help me? How did you fix it?

This worked for me as well.