question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mongod binary installing in the wrong directory of workspace PNPM

See original GitHub issue

Versions

  • NodeJS: 14.16.1
  • mongodb-memory-server-*: 7.0.0-beta.49
  • mongodb(the binary version): 4.0.25
  • mongoose: 5.12.15
  • system: Windows 10

package: mongo-memory-server

What is the Problem?

MMS = mongodb-memory-server

I use MMS in a package of workspace and after installing dependencies and running a test script in the package, MMS tries to download the binary file. But if I run the test command from the root folder of the workspace, MMS can find the binary file from node_modules/.cache folder.

What I mean by root directory is: C:\Users\Sahin\projects\temp\mongodb-memory-server-issue-x And what I meant by package directory is: C:\Users\Sahin\projects\temp\mongodb-memory-server-issue-x\packages\my-app

Here is the folder structure: image

Code Example

Here is the minimal repo https://github.com/seahindeniz/mongodb-memory-server-issue-489

Do you know why it happenes?

I’m not sure why, but I guess postinstall script installs the binary file to the upper node_modules folder rather than installing to the closest node_modules folder and using it from the closest node_modules. I guess it should work respectfully

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:17

github_iconTop GitHub Comments

1reaction
hasezoeycommented, Jul 1, 2021

closing, because workaround (PREFER_GLOBAL_PATH) works and wontfix label

1reaction
hasezoeycommented, Jun 29, 2021

I understand that MongoMS is now downloading and using the binary from temp folder- which I assume it is the default behavior of using preferGlobalPath option.

like i said earlier, this temporary directory is only for the DataBase Path, not the Binary or Download path

and preferGlobalPath will install it into the current users home directory (on POSIX systems, its ~/.cache/mongodb-binaries, and on DOS systems, its %USERPROFILE%/.cache/mongodb-binaries - both using os.homedir())

and as you can see by the output of

MongoMS:DryMongoBinary generateDownloadPath: Found binary in legacyHomeCache: "C:\Users\Sahin\.cache\mongodb-binaries\mongod-x64-win32-4.0.25.exe" +18ms

the binary is stored at C:\Users\Sahin\.cache\mongodb-binaries\mongod-x64-win32-4.0.25.exe

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installation process saves binary in wrong location · Issue #168
In version 5.0.1, when the package is installed the binary is not downloaded to the default location (.
Read more >
Error Codes | pnpm
This error happens when installation cannot be performed without changes to the lockfile. This might happen in a CI environment if someone has...
Read more >
Mongo.exe file is missing in bin folder - MongoDB
i have been facing the same problem, mongo.exe file is missing in bin folder, not getting any way to find the solution to...
Read more >
NPM stuck giving the same error EISDIR: Illegal operation on ...
This means that NPM is trying to do something to a file but it is a directory. In your case, NPM is trying...
Read more >
User and Workspace Settings - Visual Studio Code
To modify user settings, you'll use the Settings editor to review and change VS Code settings. To open the Settings editor, use the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found