Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crashes on npm run dev #220

Closed
talha970 opened this issue Jan 14, 2020 · 3 comments
Closed

crashes on npm run dev #220

talha970 opened this issue Jan 14, 2020 · 3 comments

Comments

@talha970
Copy link

Error: db is an invalid option. at Mongoose.set (/Users/tjaved/Documents/rest/node_modules/mongoose/lib/index.js:173:48) at /Users/tjaved/Documents/rest/src/services/mongoose/index.js:6:12 at Array.forEach (<anonymous>) at Object.<anonymous> (/Users/tjaved/Documents/rest/src/services/mongoose/index.js:5:28) at Module._compile (internal/modules/cjs/loader.js:688:30) at loader (/Users/tjaved/Documents/rest/node_modules/babel-register/lib/node.js:144:5) at Object.require.extensions.(anonymous function) [as .js] (/Users/tjaved/Documents/rest/node_modules/babel-register/lib/node.js:154:7) at Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad (internal/modules/cjs/loader.js:537:12) at Function.Module._load (internal/modules/cjs/loader.js:529:3) at Module.require (internal/modules/cjs/loader.js:636:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/Users/tjaved/Documents/rest/src/app.js:3:1) at Module._compile (internal/modules/cjs/loader.js:688:30) at loader (/Users/tjaved/Documents/rest/node_modules/babel-register/lib/node.js:144:5) at Object.require.extensions.(anonymous function) [as .js] (/Users/tjaved/Documents/rest/node_modules/babel-register/lib/node.js:154:7) at Module.load (internal/modules/cjs/loader.js:598:32) at tryModuleLoad (internal/modules/cjs/loader.js:537:12) at Function.Module._load (internal/modules/cjs/loader.js:529:3) at Module.require (internal/modules/cjs/loader.js:636:17) at require (internal/modules/cjs/helpers.js:20:18) at Object.<anonymous> (/Users/tjaved/Documents/rest/src/index.js:3:28)

I am seeing this crash when i run npm run dev. Any help would be appreciated.

@martofeld
Copy link

If you comment lines 31 through 35 in config.js it works. It looks like mongoose doesn't recognize the db object as a valid configuration. I assume its used for the safe param but its not in the valid list of mongoose params.

@Romainpetit
Copy link

File src/config.js changed, making the commenting above hard to apply

@pedro-victor
Copy link
Collaborator

Fixed by PR #223 .
If you want to manually apply the fix, please see this change in generators/app/templates/src/config.js : https://github.com/diegohaz/rest/pull/223/files#diff-d9a3743e726cce2ff7d281b6e4979c25R40

diegohaz pushed a commit that referenced this issue Mar 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants