-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lmdb no native build was found with node-gyp-build-optional-packages and linux platform #312
Comments
Here is my package.json
|
The use of optional dependencies is how the right binary package gets installed. lmdb-js lists all the binary packages as optional dependencies, and then package manager installs the one that matches the machine's "os" and "cpu" as listed in the package.json. So here, you are trying to tell pnpm to install a different os/cpu than the installing machine's? Does that really cause pnpm to match on a different os/cpu (AFAICT, those args don't really do that)? FWIW, lmdb-js does include a package.json bin script |
Yes my machine itself (and the build server) run on Windows. I found this thread on pnpm about the possibility of cross platform installations: pnpm/pnpm#5965 and this merged request pnpm/pnpm#5965. So it seems like it should be possible. Besides when I run it without the flags the installation performs just fine so I wonder what the flags would be used for otherwise. The error also shows that node-gyp-build-optional-packages tries to find the build for a linux platform. Looking at the source code it shows that they get the platform from the config. // \node_modules\.pnpm\[email protected]\node_modules\node-gyp-build-optional-packages\node-gyp-build.js:19
var platform = process.env.npm_config_platform || os.platform() Is this a node-gyp issue then? |
Does pnpm set these env variables/config? |
Adding the flag is the same as setting them in your npmrc file. |
Hello there! I am using Angular together with Nx, PNPM and node18.20.4. I am trying to migrate to the latest version of Angular (18.2.11), which has a dependency on lmbd. I want to build and install my packages for a linux platform with x64 architecture. When installing packages with the command
The installation works fine but I run into issues in the postinstall script where the following exception is thrown:
The package @lmdb/lmdb-linux-x64 is listed under optionalDepencies but in this case should clearly be installed. I am aware that I can resolve this issue by installing the packages using the --force option, however I prefer to not install all packages forcibly on my build server. Is this a problem with lmdb and how can I resolve this?
The text was updated successfully, but these errors were encountered: