mongodb-js / mongodb-prebuilt

Install MongoDB prebuilt package using npm https://npmjs.org/package/mongodb-prebuilt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails to start on Windows

hgcummings opened this issue · comments

start_server no longer works on Windows. Stacktrace below:

Error: spawn UNKNOWN
at exports._errnoException (util.js:856:11)
at ChildProcess.spawn (internal/child_process.js:298:11)
at Object.exports.spawn (child_process.js:362:9)
at start (E:\Stuff\projects\nodejs\chapter11\node_modules\mongodb-prebuilt\index.js:54:21)
at Object.start_server (E:\Stuff\projects\nodejs\chapter11\node_modules\mongodb-prebuilt\index.js:47:3)
at start_server (E:\Stuff\projects\nodejs\chapter11\node_modules\mockgoose\Mockgoose.js:92:33)
at Mongoose.mongoose.connect (E:\Stuff\projects\nodejs\chapter11\node_modules\mockgoose\Mockgoose.js:28:9)
at Object. (E:\Stuff\projects\nodejs\chapter11\src\config\mongoose.js:13:10)
at Module._compile (module.js:425:26)
at Object.Module._extensions..js (module.js:432:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:313:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at Object. (E:\Stuff\projects\nodejs\chapter11\src\server.js:3:18)
at Module._compile (module.js:425:26)

Looks like this was broken by the recent change to add a process killer script. I'll raise a PR with a fix imminently.

@hgcummings is this resolved now? if so, can you please close this ticket?

Yes, thank you, resolved since the release including the linked PR.

commented

I think i'm still having this issue in Windows 10. I came to know mongodb-prebuilt via https://github.com/tmeasday/create-graphql-server/. What was the solution?

there was a big rewrite that fixed most of the issues since this issue was reported. i looked at https://github.com/tmeasday/create-graphql-server and i don't see in in package.json mongodb listed as dependency.

commented

Uh you are right .. But doing yarn global add create-graphql-server comes with mongodb-prebuilt though. By the way, it comes with mongodb-prebuilt@^5.0.7. The only solution was to use an existing mongodb installation.

@dukuo 6.x is a complete rewrite in typescript, and that is the one that gets rid of --fork, which was breaking windows mongodb release. there is an API change in 6.x but very minor, in fact, if you know which package is using mongodb-prebuilt or mockgoose, I can do changes and submit a PR