{"action":"created","issue":{"url":"https://api.github.com/repos/crudlio/crudl-example-express/issues/9","repository_url":"https://api.github.com/repos/crudlio/crudl-example-express","labels_url":"https://api.github.com/repos/crudlio/crudl-example-express/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/crudlio/crudl-example-express/issues/9/comments","events_url":"https://api.github.com/repos/crudlio/crudl-example-express/issues/9/events","html_url":"https://github.com/crudlio/crudl-example-express/issues/9","id":285792009,"number":9,"title":"initdb script path conflicts on a Windows machine","user":{"login":"amanowar","id":5509688,"avatar_url":"https://avatars0.githubusercontent.com/u/5509688?v=4","gravatar_id":"","url":"https://api.github.com/users/amanowar","html_url":"https://github.com/amanowar","followers_url":"https://api.github.com/users/amanowar/followers","following_url":"https://api.github.com/users/amanowar/following{/other_user}","gists_url":"https://api.github.com/users/amanowar/gists{/gist_id}","starred_url":"https://api.github.com/users/amanowar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amanowar/subscriptions","organizations_url":"https://api.github.com/users/amanowar/orgs","repos_url":"https://api.github.com/users/amanowar/repos","events_url":"https://api.github.com/users/amanowar/events{/privacy}","received_events_url":"https://api.github.com/users/amanowar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-01-03T19:55:04Z","updated_at":"2018-04-19T15:09:30Z","closed_at":null,"author_association":"NONE","body":"I'm trying to get the example code running on a Windows machine. It looks like the pow-mongoose-fixtures dependency makes a lot of assumptions about what file paths look like, so the initdb script fails. \r\n\r\n> Loading fixtures ... C:\\Users\\amand\\Development\\Crudl-Example-Express\\blog\\node_modules\\pow-mongoose-fixtures\\mongoose_fixtures.js:38\r\n>            if (err) throw err;\r\n>                    ^\r\n>\r\n> Error: ENOENT: no such file or directory, stat 'C:\\C:\\Users\\amand\\Development\\Crudl-Example-Express\\blog\\scripts\\fixtures.js'\r\n> npm ERR! code ELIFECYCLE\r\n> npm ERR! errno 1\r\n> npm ERR! crudl-express-blog@0.2.0 initdb: `node ./scripts/initdb.js`\r\n> npm ERR! Exit status 1\r\n> npm ERR!\r\n> npm ERR! Failed at the crudl-express-blog@0.2.0 initdb script.\r\n> npm ERR! This is probably not a problem with npm. There is likely additional logging output above.\r\n>\r\n> npm ERR! A complete log of this run can be found in:\r\n> npm ERR!     C:\\Users\\amand\\AppData\\Roaming\\npm-cache\\_logs\\2018-01-03T19_36_38_457Z-debug.log\r\n\r\nThe offending code is doing some manual path manipulations. I went through and replaced '/' with '\\\\\\\\', and had to replace the forward slash inside of the initdb script as well (i.e., \"\\fixtures.js\"). I also found that I had to take out two blocks that try to check for relative paths, i.e., \r\n> // Get the absolute dir path if a relative path was given\r\n> if (file.substr(0, 1) !== '/') {\r\n>      /* some path manipulation */\r\n> }"},"comment":{"url":"https://api.github.com/repos/crudlio/crudl-example-express/issues/comments/382772418","html_url":"https://github.com/crudlio/crudl-example-express/issues/9#issuecomment-382772418","issue_url":"https://api.github.com/repos/crudlio/crudl-example-express/issues/9","id":382772418,"user":{"login":"juliobasito","id":15653108,"avatar_url":"https://avatars3.githubusercontent.com/u/15653108?v=4","gravatar_id":"","url":"https://api.github.com/users/juliobasito","html_url":"https://github.com/juliobasito","followers_url":"https://api.github.com/users/juliobasito/followers","following_url":"https://api.github.com/users/juliobasito/following{/other_user}","gists_url":"https://api.github.com/users/juliobasito/gists{/gist_id}","starred_url":"https://api.github.com/users/juliobasito/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/juliobasito/subscriptions","organizations_url":"https://api.github.com/users/juliobasito/orgs","repos_url":"https://api.github.com/users/juliobasito/repos","events_url":"https://api.github.com/users/juliobasito/events{/privacy}","received_events_url":"https://api.github.com/users/juliobasito/received_events","type":"User","site_admin":false},"created_at":"2018-04-19T15:09:30Z","updated_at":"2018-04-19T15:09:30Z","author_association":"NONE","body":"Hello,\r\n\r\nI have the same problem on my windows machine so I follow this issue : [](https://github.com/powmedia/mongoose-fixtures/issues/29).\r\n\r\nI cut the first three characters of my dirname with `.substr(3)` on the following /bloc/initdb.js \r\n`mongoose.connection.once('open', function () {\r\n    process.stdout.write('Loading fixtures ... ')\r\n    fixtures.load(__dirname.substr(3) + '/fixtures.js', mongoose, function(err) {\r\n        process.stdout.write('done.\\n'.green)\r\n        process.exit()\r\n    })\r\n})`\r\n\r\nAnd It's worked temporarily for me. But I think we must follow [](https://github.com/powmedia/mongoose-fixtures/issues/29#issuecomment-204788064 ) to fix cleanly the problem."}}
{"actor":{"display_login":"juliobasito"}}