StephenGrider / FullstackReactCode

Companion repo to https://www.udemy.com/node-with-react-fullstack-web-development
1.39k stars 1.17k forks source link

Missing modules when running npm run build or npm install #2

Open Jeffchiucp opened 7 years ago

Jeffchiucp commented 7 years ago

Hi.

I am starting with the Udemy class on a server project and I am trying to get it all setup and working.

I have cloned the preexisting repository howoever every time I run pretty much any npm command I get the following output:

node index.js

module.js:327 throw err; ^

Error: Cannot find module './dev' at Function.Module._resolveFilename (module.js:325:15) at Function.Module._load (module.js:276:25) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (/Users/jchiu/Desktop/javascript/FullStackSteven/FullstackReactCode/server/config/keys.js:7:20) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at Object. (/Users/jchiu/Desktop/javascript/FullStackSteven/FullstackReactCode/server/index.js:6:14) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! server@1.0.0 start: node index.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the server@1.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

I have uninstalled node_modules completely and reinstalled it again.

rm -rf node_modules npm install provide the contents of that error message

It seems that I must have large dependency missing because every time I try to install the module that it says its missing it just complains about another module missing. Im a bit new to these package managers but aren't supposed to take care of all the dependencie.

Thank you.

raineydavid commented 7 years ago

hi @Jeffchiucp - this error is generated by this line (/Users/jchiu/Desktop/javascript/FullStackSteven/FullstackReactCode/server/config/keys.js:7:20), ie the keys file in the server > config folder. If you inspect it you see it asks for the dev file (.js is implicit). Just clone the server/config/prod.js and call it server/config/dev.js