gendocu-com / grpc-docs

56 stars 6 forks source link

How to install dependenies? #11

Open nmezhenskyi opened 1 year ago

nmezhenskyi commented 1 year ago

Could you give an example on how to install required frontend dependencies and run the example? I was following this guide but encountered issues with installing dependencies for the frontend.

jacquayj commented 1 year ago

@nmezhenskyi If your error looked something like this:

error An unexpected error occurred: "https://roadiehq.jfrog.io/artifactory/api/npm/roadiehq/react-copy-to-clipboard/-/react-copy-to-clipboard-5.1.0.tgz: Request failed \"401 Unauthorized\"".

It's because example/yarn.lock is referencing a private repo:

...
  resolved "https://roadiehq.jfrog.io/artifactory/api/npm/roadiehq/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d"
...

https://github.com/gendocu-com/grpc-docs/blob/master/example/yarn.lock#L7

The solution is to run yarn install from the repo's root directory. Then yarn build from the example/ directory. Here's a working Dockerfile:

FROM node:19 as build

WORKDIR /app

RUN git clone https://github.com/gendocu-com/grpc-docs.git

WORKDIR /app/grpc-docs

# pin to version
RUN git reset --hard b431901

RUN yarn install
WORKDIR /app/grpc-docs/example

RUN yarn build