vite: not found on development setup
This is throw on a fresh docker dev env (after git clone, git fetch, git pull) :
sudo docker compose -f dev.yml up --build front
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "COMPOSE_PROJECT_NAME" variable is not set. Defaulting to a blank string.
WARN[0000] The "DJANGO_ALLOWED_HOSTS" variable is not set. Defaulting to a blank string.
WARN[0000] network federation: network.external.name is deprecated in favor of network.name
Sending build context to Docker daemon 2.065MB
Step 1/9 : FROM node:16-buster
---> 1e151315aa91
Step 2/9 : RUN apt-get update && apt-get install -y jq
---> Using cache
---> 3cf6fad1e33b
Step 3/9 : EXPOSE 8080
---> Using cache
---> 5d680345abd0
Step 4/9 : WORKDIR /app/
---> Using cache
---> 19d0d3f091f7
Step 5/9 : COPY scripts/ ./scripts/
---> Using cache
---> f49e1b10874e
Step 6/9 : ADD package.json yarn.lock ./
---> Using cache
---> 57e316321cf7
Step 7/9 : RUN yarn install
---> Using cache
---> c6d77e8fb0c1
Step 8/9 : COPY . .
---> Using cache
---> ebfcafc60965
Step 9/9 : CMD ["yarn", "serve"]
---> Using cache
---> e7b858f090f2
Successfully built e7b858f090f2
Successfully tagged funkwhale_front:latest
Use 'docker scan' to run Snyk tests against images to find vulnerabilities and learn how to fix them
[+] Running 1/1
⠿ Container funkwhale-front-1 Recreated 0.4s
Attaching to funkwhale-front-1
funkwhale-front-1 | yarn run v1.22.17
funkwhale-front-1 | $ vite preview
funkwhale-front-1 | /bin/sh: 1: vite: not found
funkwhale-front-1 | error Command failed with exit code 127.
funkwhale-front-1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
funkwhale-front-1 exited with code 127
On the local computer :
- Docker version 20.10.12, build e91ed57
- Docker Compose version v2.2.3
- yarn 1.22.17
- specifying
NODE_ENV=development
in.env
do not resolve the issue
On the front container :
-
vite
returnnot found
-
yarn vite
works
to invest : the image config file args' are ["bash"] while the working ones are ["yarn", "dev"]