JKHeadley / rest-hapi

🚀 A RESTful API generator for Node.js
https://resthapi.com
MIT License
1.19k stars 153 forks source link

Windows Error #128

Open ChicagoDave opened 6 years ago

ChicagoDave commented 6 years ago

Describe the bug C:\projects\git\rest-hapi-demo>npm start

rest-hapi-demo@1.0.0 start C:\projects\git\rest-hapi-demo node api.js

[12:47:26.046] 2872 LOG api/mongoose-init — Connecting to Database...: [12:47:26.056] 2872 LOG api/mongoose-init — URI: mongodb://localhost:27017/rest_hapi [12:47:26.066] 2872 LOG api/mongoose-init — mongoose connected [12:47:26.067] 2872 LOG api — Initializing Server... (node:2872) DeprecationWarning: open() is deprecated in mongoose >= 4.11.0, use openUri() instead, or set the useMongoClient option if using connect() or createConnection(). See http://mongoosejs.com/docs/4.x/docs/connections.html#use-mongo-client [12:47:26.097] 2872 ERROR node_modules\rest-hapi\utilities\model-generator.js:32:15 api/model-generator — Error: ENOENT: no such file or directory, scandir 'C:\projects\git\rest-hapi-demo\models' Error starting server: Error: The model directory provided is either empty or does not exist. Try setting the 'modelPath' property of the config file. at fs.readdir (C:\projects\git\rest-hapi-demo\node_modules\rest-hapi\utilities\model-generator.js:34:13) at FSReqWrap.oncomplete (fs.js:135:15)

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior No error?

Screenshots See above

Desktop (please complete the following information):

Additional context I also saw a DDOS warning for minimatch to be updated to 3.0.2 or higher.

JKHeadley commented 6 years ago

@ChicagoDave did you seed the models directory by running:

$ ./node_modules/.bin/rest-hapi-cli seed

?