Mongod binary installing in the wrong directory of workspace PNPM
See original GitHub issueVersions
- 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:
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:
- Created 2 years ago
- Comments:17
closing, because workaround (
PREFER_GLOBAL_PATH
) works andwontfix
labellike 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 usingos.homedir()
)and as you can see by the output of
the binary is stored at
C:\Users\Sahin\.cache\mongodb-binaries\mongod-x64-win32-4.0.25.exe