Code Monkey home page Code Monkey logo

Comments (13)

cmosgh avatar cmosgh commented on August 31, 2024 1

would be my first. I should try tho :)

from mongodb-memory-server.

nodkz avatar nodkz commented on August 31, 2024

@cmosgh thanks for debugging. 👌

Can you provide you folder structure by path C:\Users\Username\.mongodb-binaries\3.4.4 ?

Or maybe you can make PR, which will find mongod.exe in these lines:
https://github.com/nodkz/mongodb-memory-server/blob/master/src/util/MongoBinaryDownload.js#L131-L133
and
https://github.com/nodkz/mongodb-memory-server/blob/master/src/util/MongoBinaryDownload.js#L71

Moreover, will be cool if you create an internal method for obtaining correct binary path according to OS something like:

class MongoBinaryDownload {
  ...
  _getMongodPath(): string {
    if (this.platform === 'win32') {
      return __correct path___
    } else {
      return path.resolve(this.downloadDir, this.version, 'mongod');
    }
  }
}

from mongodb-memory-server.

nodkz avatar nodkz commented on August 31, 2024

I'm on MacOS and make a proper fix for Win quite hard for me.
Thanks for help!

from mongodb-memory-server.

cmosgh avatar cmosgh commented on August 31, 2024

MongoBinaryDownload looks for C:\Users\UserName\.mongodb-binaries\3.4.4\mongod

but the .mongodb-binaries contains only the zip archive and an empty folder folder 3.4.4

it seems that for some reason it doesn't extract the archive

from mongodb-memory-server.

nodkz avatar nodkz commented on August 31, 2024

So it look like that filter in decompress contains incorrect value under win32 (problems with backslash)
https://github.com/nodkz/mongodb-memory-server/blob/master/src/util/MongoBinaryDownload.js#L123

from mongodb-memory-server.

cmosgh avatar cmosgh commented on August 31, 2024

I can give you the path it receives sec

from mongodb-memory-server.

cmosgh avatar cmosgh commented on August 31, 2024

ah its pretty simple I think. since macos doesn't need .exe
filter should have added .exe and the path resolve should have the same appended

from mongodb-memory-server.

nodkz avatar nodkz commented on August 31, 2024

Yep needs to check this.platform === 'win32' and if is true then use path and filter for windows, otherwise keep existed values for linux and mac.

Would you try to do PR?

from mongodb-memory-server.

cmosgh avatar cmosgh commented on August 31, 2024

created a pull request but it fails to build because of prettier... haven't got that configured locally so..., maybe you can tho use the code?

from mongodb-memory-server.

nodkz avatar nodkz commented on August 31, 2024

Ok i'll do it.
Many thanks for PR!

from mongodb-memory-server.

nodkz avatar nodkz commented on August 31, 2024

Congrat with first PR 🎉

from mongodb-memory-server.

nodkz avatar nodkz commented on August 31, 2024

Published https://github.com/nodkz/mongodb-memory-server/releases/tag/v1.6.1

from mongodb-memory-server.

ozanmuyes avatar ozanmuyes commented on August 31, 2024

For what is worth set the binary.systemBinary option (as listed at here) to point to the correct path on the filesystem (where npm postinstall actually downloads the binary). For me this systemBinary is "X:\Project\Root\node_modules\mongodb-memory-server\node_modules\.cache\mongodb-memory-server\mongodb-binaries\x.y.z\mongod.exe" (note the double slash on Windows). Hope this helps, because even version 3.0.0 of this package wasn't working for me.

from mongodb-memory-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.