Skip to content
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

Error: Cannot find module '@napi-rs/snappy-linux-x64-gnu' - on M1 Mac #84

Closed
askprateek opened this issue Aug 24, 2022 · 4 comments
Closed

Comments

@askprateek
Copy link

image

I'm getting this error while running the app via docker-compose

Snappy: 7.1.2
Laptop: M1 Macbook Pro

@Brooooooklyn
Copy link
Owner

@askprateek have you run the installation in the Docker container?

@askprateek
Copy link
Author

askprateek commented Aug 30, 2022

Yes, @Brooooooklyn. I'm running the installation in the docker container with host node_modules mounted in the container. NPM installed happened in the host machine.

docker buildx ls gives me this

desktop-linux   docker
  desktop-linux desktop-linux   running linux/arm64, linux/amd64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
default *       docker
  default       default         running linux/arm64, linux/amd64, linux/riscv6
  

@Brooooooklyn
Copy link
Owner

@askprateek are you using npm? there is a bug in npm related: npm/cli#4828.

@askprateek
Copy link
Author

We were able to solve this.
We forcefully installed the required package to make it work.

Our understanding is

  • You run npm install on M1 mac. It installs darwin binaries.
  • You run docker build: it creates an image on architecture: linux/x64. We got this info using the docker inspect command.
  • This is resulting in a mismatch.

To solve this we ran npm i @napi-rs/snappy-linux-arm64-gnu --save-dev -f to forcefully install the package on my Mac M1 machine to temp fix the dependency issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants