-
Notifications
You must be signed in to change notification settings - Fork 47
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. |
Hi, I am also facing the same while trying to migrate to Angular 18v and i have node version as v18.20.4 and npm version as 10.7.0 on my window machine , while trying to publish package on team-dev server via jenkins, install step getting failed with below error npm error: Error: No native build was found for platform=linux arch=x64 runtime=node abi=108 uv=1 libc=glibc node=18.20.4 Error resolving package: Cannot find module '@lmdb/lmdb-linux-x64' Is this issue fixed? If yes, please assist with the solution for the same |
Hey there, unfortunately I was unable to resolve this issue. We are planning on containerizing our building process so that we can build it inside of a linux environment (in my case I was building on windows for linux). |
@darora8147, @NiekZndt if your issue is still relevant, I found solution to this. Just added other variants of darwin/linux/win32 and arm/arm64/x64 as dependency to my package-lock.json and the problem was gone. I noticed this code is generated in package-lock.json if you reference lmdb explicitly. Also upgrading Angular to 19.x helps since lmdb is optional package there. Here are deps you can copy and paste:
|
Ah thank you so much. At the time Angular 19 was not released yet so we ended up containerizing our build server which was the way to go anyways. Thanks regardless! |
Hi@mateher624 I have tried the solution suggested by you regarding adding of other variants of darwin/linux/win32 and arm/arm64/x64 as dependency to my package-lock.json, but no luck. I am still getting the same below error. npm error: Error: No native build was found for platform=linux arch=x64 runtime=node abi=108 uv=1 libc=glibc node=18.20.4 Error resolving package: Cannot find module '@lmdb/lmdb-linux-x64' Please assist |
We currently have the same issue on a CI node, it works on our MacBooks with Apple silicon chips. Weirdly it works in other builds on the same CI nodes and there is no big difference in either package.json or package-lock.json. |
@darora8147 we were able to fix the issue. We carefully rebuilt |
@rogerwalt Could it be that your package-lock is included in your version control? Perhaps someone pushed a package-lock version for a different system to remote. |
Yes definitely. We couldn't figure out how |
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: