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

NPM is throwing a bunch of errors when I try to install SQLite3

Whenever I run npm install --save sqlite3@^4.0.9 in my integrated terminal in Visual Studio Code, NPM throws these errors:

npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported       

> sqlite3@4.0.9 install C:\Users\babyoscar\Documents\sql-orms-with-node\node_modules\sqlite3
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(403): https://mapbox-node-binary.s3.amazonaws.com/sqlite3/v4.0.9/node-v83-win32-x64.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for sqlite3@4.0.9 and node@14.15.1 (node-v83 ABI, unknown) (falling back to source compile with node-gyp) 
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\Common7\IDE\VC\VCTa
rgets\Microsoft.Cpp.Platform.targets(67,5): error MSB8020: The build tools for v14
0 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools 
, please install v140 build tools.  Alternatively, you may upgrade to the current  
Visual Studio tools by selecting the Project menu or right-click the solution, and 
 then selecting "Retarget solution". [C:\Users\babyoscar\Documents\sql-orms-with-node\n 
ode_modules\sqlite3\build\deps\action_before_build.vcxproj]
gyp ERR! build error 
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:194:23)
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 Windows_NT 10.0.19041
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--module=C:\\Users\\babyoscar\\Documents\\sql-orms-with-node\\node_modules\\sqlite3\\lib\\binding\\node-v83-win32-x64\\node_sqlite3.node" "--module_name=node_sqlite3" "--module_path=C:\\Users\\babyoscar\\Documents\\sql-orms-with-node\\node_modules\\sqlite3\\lib\\binding\\node-v83-win32-x64" "--napi_version=7" "--node_abi_napi=napi" "--napi_build_version=0" "--node_napi_label=node-v83"
gyp ERR! cwd C:\Users\babyoscar\Documents\sql-orms-with-node\node_modules\sqlite3
gyp ERR! node -v v14.15.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe 
C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\babyoscar\Documents\sql-orms-with-node\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\babyoscar\Documents\sql-orms-with-node\node_modules\sqlite3\lib\binding\node-v83-win32-x64 --napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\babyoscar\Documents\sql-orms-with-node\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:315:20)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1048:16)      
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
node-pre-gyp ERR! System Windows_NT 10.0.19041
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\babyoscar\\Documents\\sql-orms-with-node\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd C:\Users\babyoscar\Documents\sql-orms-with-node\node_modules\sqlite3
node-pre-gyp ERR! node -v v14.15.1
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --module=C:\Users\babyoscar\Documents\sql-orms-with-node\node_modules\sqlite3\lib\binding\node-v83-win32-x64\node_sqlite3.node --module_name=node_sqlite3 --module_path=C:\Users\babyoscar\Documents\sql-orms-with-node\node_modules\sqlite3\lib\binding\node-v83-win32-x64 
--napi_version=7 --node_abi_napi=napi --napi_build_version=0 --node_napi_label=node-v83' (1)
npm WARN sql-orms-with-node@1.0.0 No description
npm WARN sql-orms-with-node@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sqlite3@4.0.9 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sqlite3@4.0.9 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\babyoscar\AppData\Roaming\npm-cache\_logs\2021-01-21T16_07_09_858Z-debug.log

and then it doesn't work if I run npm start, since I didn't install SQLite3 successfully. Can someone help? Thanks.

2 Answers

babyoscar i also encountered this, it seems that it is a problem with the new version of sqlite3, maybe its corrupted or specific libraries are deprecated because all other versions work. try running npm install --save sqlite3@^5.0.0 its a more recent one that is not that old

Thanks! It worked. Are there any breaking changes since v5.0.0 is one major release ahead of this course?

babyoscar i am about halfway through the course, and so far I had not had an issue with it. Core functionality should stay the same, and it shouldn’t matter too much since you are working mostly with sequelize. If u have any questions just tag me.

Okay, thanks!

It failed for me as well when I was trying to install version 4.0.9

Thanks for the solution.

I installed both sequelize and sqlite without any issues. I installed them through the dependencies in package.json with npm install rather than separately at the command line with no issues. After deleting the node modules and dependencies I tried to install them both at the command line and also got the same error.