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

Error on Server startup #10

Closed
varunachar opened this issue Nov 1, 2015 · 6 comments
Closed

Error on Server startup #10

varunachar opened this issue Nov 1, 2015 · 6 comments

Comments

@varunachar
Copy link

I've integrated sails-swagger like it's mentioned in the Read me file. I'm getting the following error:

debug: hookPath: /Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/dist/api/hooks/swagger
debug: marlinspike (swagger): loading config from /Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/dist/config
debug: marlinspike (swagger): loading Services from /Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/dist/api/services...
info: Error: ENOENT: no such file or directory, scandir '/Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/dist/api/services'
    at Error (native)
    at Object.fs.readdirSync (fs.js:813:18)
    at requireAll (/Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/node_modules/marlinspike/node_modules/require-all/index.js:12:18)
    at Swagger.loadServices (/Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/node_modules/marlinspike/dist/marlinspike.js:129:52)
    at Hook.configure (/Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/node_modules/marlinspike/dist/marlinspike.js:198:51)
    at Hook.bound [as configure] (/usr/local/lib/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21)
    at /usr/local/lib/node_modules/sails/lib/app/private/loadHooks.js:176:18
    at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:122:13
    at _each (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:46:13)
    at Object.async.each (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:121:9)
    at Object.async.series.configure (/usr/local/lib/node_modules/sails/lib/app/private/loadHooks.js:174:17)
    at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:620:25
    at iterate (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:146:13)
    at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:157:25
    at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:626:21
    at done (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:132:19) { [Error: ENOENT: no such file or directory, scandir '/Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/dist/api/services']
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/dist/api/services' }
warn: marlinspike (swagger): no Services found. skipping
debug: marlinspike (swagger): loading Controllers...
debug: marlinspike (swagger): loading Policies...
info: Error: ENOENT: no such file or directory, scandir '/Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/dist/api/policies'
    at Error (native)
    at Object.fs.readdirSync (fs.js:813:18)
    at requireAll (/Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/node_modules/marlinspike/node_modules/require-all/index.js:12:18)
    at Swagger.loadPolicies (/Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/node_modules/marlinspike/dist/marlinspike.js:93:52)
    at Hook.configure (/Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/node_modules/marlinspike/dist/marlinspike.js:201:51)
    at Hook.bound [as configure] (/usr/local/lib/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21)
    at /usr/local/lib/node_modules/sails/lib/app/private/loadHooks.js:176:18
    at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:122:13
    at _each (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:46:13)
    at Object.async.each (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:121:9)
    at Object.async.series.configure (/usr/local/lib/node_modules/sails/lib/app/private/loadHooks.js:174:17)
    at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:620:25
    at iterate (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:146:13)
    at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:157:25
    at /usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:626:21
    at done (/usr/local/lib/node_modules/sails/node_modules/async/lib/async.js:132:19) { [Error: ENOENT: no such file or directory, scandir '/Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/dist/api/policies']
  errno: -2,
  code: 'ENOENT',
  syscall: 'scandir',
  path: '/Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/dist/api/policies' }
warn: marlinspike (swagger): no Policies found. skipping

I checked the node modules directory and the only folders that exist inside the dist folder are:

api/
|_ controllers/
|_ ..files
|_ hooks/
|swagger/
|
..files
|_ models/
config/
|_ ..files
lib/
|_ ..files

@svenarndt
Copy link

+1
I have the same problem here. Tried it with 0.11.2 and 0.12.0-rc3. Did anyone get it to work lately?

Thanks
Sven

@loeckelt
Copy link

loeckelt commented Nov 2, 2015

+1
We als encountered the same. Would be happy to hear any workaround or a solution for this!

Best,
Michael

@AlexisNo
Copy link
Contributor

AlexisNo commented Nov 3, 2015

It's just a warning message that doesn't impact the behavior of the hook. It doesn't appear using the master branch of Sails. If you don't want to see these messages, you could create these 2 empty folders:

  • node_modules/sails-swagger/dist/api/services
  • node_modules/sails-swagger/dist/api/policies

@svenarndt
Copy link

Thank you Alexi,

this removed the warnings for me. My remaining problems is discussed in ticket #3

Regards,
Sven

@tjwebb
Copy link
Member

tjwebb commented Nov 5, 2015

info: Error: ENOENT: no such file or directory, scandir '/Users/varunachar/Work/learn/sample-sails/node_modules/sails-swagger/dist/api/services'

These are benign errors; I added some extra logging and haven't removed them.

@varunachar
Copy link
Author

Thanks.. As mentioned by Sven, I too am stuck with #3. I've fixed it with the steps mentioned by @AlexisNo, but ideally I shouldn't have to. Looking forward to a stable release

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

5 participants