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

"node-pre-gyp install --fallback-to-build" in node v12.16.3 / arm64 / Rasbperry Pi #803

Closed
way2key opened this issue May 26, 2020 · 5 comments

Comments

@way2key
Copy link

way2key commented May 26, 2020

@recrsn
Copy link
Collaborator

recrsn commented May 27, 2020

Looks like you have a permission issue (Why is it trying to install under /home/node_modules)

Please assert that your user haswrite access to all the paths listed in the error log

bcrypt or any library with native components will not install properly under sudo /root without --unsafe-perm flag in NPM

@way2key
Copy link
Author

way2key commented May 27, 2020

Hello, initially I tried to install it inside a docker container and I could't retrieve the logs because the container never finished the building process. Instead, I tried to run npm install bcrypt inside my home folder to check if it was working with my machine. I changed the line in my dockerfile with --unsafe-perm and I have the same error until node-pre-gyp ERR! not ok. I tried to run sudo docker-compose and it was the same but if I type sudo npm install bcrypt it's installing properly on my home folder. What should I change to my dockerfile?

@recrsn
Copy link
Collaborator

recrsn commented Jun 1, 2020

@way2key I will need to see the Dockerfile to suggest changes

@way2key
Copy link
Author

way2key commented Jun 2, 2020

Hello,
To reproduce the problem:
This is my repo and bcrypt is related to the backend.

This the docker compose file:

version: '3.1'

services:
        frontend:
                container_name: clockmachine-frontend
                depends_on:
                        - database 
                        - backend
                image: clockmachine-frontend
                build:
                        context: ./frontend
                        dockerfile: frontend.dockerfile
                ports:
                        - "80:80"
        database:
                container_name: mongo
                image: mongo
                ports:
                        - "27017:27017"

        backend:
                container_name: clockmachine-api
                image: clockmachine-api
                build:
                        context: ./backend
                        dockerfile: backend.dockerfile
                environment:
                        - NODE_ENV=production
                ports:
                        - "3000:3000"

And this is the backend Dockerfile

#### Stage 0, Build API
FROM node:alpine
LABEL author="Olivier D'Ancona"
WORKDIR /app
COPY package.json ./
RUN npm install
COPY . .
EXPOSE 3000
CMD ["node","server.js"]

When I run docker-compose build on my debian amd64 pc everything run fine. But when I run on my ubuntu 20.04 amr7l raspberry there the problem rise. I use the raspberry pi 4 model b ( the cpu is Broadcom BCM2711, Quad core Cortex-A72 (ARM v8) 64-bit SoC @ 1.5GHz )

EDIT:

I was able to install bcrypt on raspbian with a 32 bits architecture. But when I run a 64 bit linux on my raspberry that's the problem rise.

@recrsn
Copy link
Collaborator

recrsn commented Jun 4, 2020

You are missing dependencies needed to compile bcrypt inside the docker see https://github.com/kelektiv/node.bcrypt.js/wiki/Installation-Instructions#alpine-linux-based-images

@recrsn recrsn closed this as completed Jun 8, 2020
@recrsn recrsn pinned this issue Jul 1, 2020
@recrsn recrsn changed the title "node-pre-gyp install --fallback-to-build" in node v12.16.3 "node-pre-gyp install --fallback-to-build" in node v12.16.3 / arm64 / Rasbperry Pi Jul 1, 2020
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