food-lookup-demo icon indicating copy to clipboard operation
food-lookup-demo copied to clipboard

Cannot find module 'sql.js'

Open sugandhgoyal opened this issue 8 years ago • 3 comments

Whenever I run npm run server it gives me this error. I have googled it a lot but haven't found the solution. what should i do? module.js:487 throw err; ^

Error: Cannot find module 'sql.js' at Function.Module._resolveFilename (module.js:485:15) at Function.Module._load (module.js:437:25) at Module.require (module.js:513:17) at require (internal/module.js:11:18) at Object. (C:/Users/ATUL/Documents/GitHub/food-lookup-demo/server.js:3:16) at Module._compile (module.js:569:30) at loader (C:\Users\ATUL\Documents\GitHub\food-lookup-demo\node_modules\babel-register\lib\node.js:144:5) at Object.require.extensions.(anonymous function) [as .js] (C:\Users\ATUL\Documents\GitHub\food-lookup-demo\node_modules\babel-register\lib\node.js:154:7) at Module.load (module.js:503:32) at tryModuleLoad (module.js:466:12) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] server: babel-node server.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] server 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\ATUL\AppData\Roaming\npm-cache_logs\2017-08-25T18_50_06_252Z-debug.lo

sugandhgoyal avatar Aug 25 '17 18:08 sugandhgoyal

Hi @sugandhgoyal

I just tested it from scratch and it's working for me. Did you npm i in both the top-level directory and inside client/?

Lmk

acco avatar Aug 30 '17 17:08 acco

Since I figure someone Googling the same exact error as me will show up here - in the Fullstack React book teaching how to write your own GraphQL server it's never said to add sql to your dependencies. So if you're having this issue trying to run sqlite3 on the seedData.js example file just run npm i [email protected] --save --save-exact and that should solve things for you.

TiE23 avatar Mar 14 '18 01:03 TiE23

This needs to be more easily accessible. I was tearing my head out for an hour trying to write sqlite functions.

mazer-rakham avatar Apr 26 '18 18:04 mazer-rakham