Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Using SQL ORMs with Node.js Getting Started with Sequelize Install and Configure Sequelize and SQLite

Need to use nvm now, too

I had trouble getting this set up, because the version of sqlite3 being used isn't compatible with the latest versions of Node.js and npm.

When I tried to npm install --save sqlite3@^4.0.9, I got a wall of errors starting with:

node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.2.0/node-v83-darwin-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.2.0 and node@14.15.4 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) 
Debugger listening on ws://127.0.0.1:65233/6628962d-ef67-40dd-b65f-8b83b02ada1b
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Waiting for the debugger to disconnect...
gyp: Call to 'node -e "require('nan')"' returned exit status 0 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/taco/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
gyp ERR! System Darwin 20.2.0

After a time, I figured out it was Node not playing nice. I installed npm (Node Package Manager), and then ran nvm use 12.7.0. Everything worked after that.

James Flood
James Flood
32,320 Points

This worked for me! Great solution. Thanks!

1 Answer