Skip to content

Commit 94668a2

Browse files
authored
Fix yarn dependencies for fresh installs (#554)
* fix: semver package causing issue on fresh installs * fix: update README with note about node modules * chore: comments about keeping Node version in-sync
1 parent d446172 commit 94668a2

File tree

6 files changed

+19
-7
lines changed

6 files changed

+19
-7
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ By default this will try to connect to http://localhost:8000 for the backend API
3030

3131
#### Installation
3232

33+
Note: if you installed the ui using Docker first (as instructed in the quick-start) then your local `node_modules/` directory will be owned by root. Change the permissions with:
34+
`sudo chown -R ${UID}:${UID} ui/node_modules`. The version of Node on your host machine must match that of the Docker container (which will be the case if you follow the `nvm` instructions below.)
35+
3336
```bash
3437
# Enter into the ui directory
3538
cd ui

compose/local/ui/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
# Node version should always match the version in `ui/.nvmrc`
12
FROM node:18
23
WORKDIR /app
4+
USER node
35
COPY package.json yarn.lock ./
46
RUN yarn install
57
COPY . .

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ services:
5252
- "4000:4000"
5353
volumes:
5454
- ./.git:/app/.git:ro
55-
- ./ui:/app:z
56-
- /app/node_modules
55+
- ./ui:/app
56+
- ./ui/node_modules:/app/node_modules
5757
depends_on:
5858
- django
5959
environment:

ui/.nvmrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
v18.12.0
2+
3+
# This should always match the version in `local/ui/Dockerfile`

ui/package.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,5 @@
9393
"ts-jest": "^29.1.1",
9494
"vite-plugin-eslint": "^1.8.1",
9595
"vite-plugin-svgr": "^4.1.0"
96-
},
97-
"resolutions": {
98-
"semver@npm:2 || 3 || 4 || 5": "6.3.1",
99-
"semver@npm:^5.6.0": "6.3.1"
10096
}
10197
}

ui/yarn.lock

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15234,7 +15234,16 @@ __metadata:
1523415234
languageName: node
1523515235
linkType: hard
1523615236

15237-
"semver@npm:6.3.1, semver@npm:^6.0.0, semver@npm:^6.3.0, semver@npm:^6.3.1":
15237+
"semver@npm:2 || 3 || 4 || 5, semver@npm:^5.6.0":
15238+
version: 5.7.2
15239+
resolution: "semver@npm:5.7.2"
15240+
bin:
15241+
semver: bin/semver
15242+
checksum: e4cf10f86f168db772ae95d86ba65b3fd6c5967c94d97c708ccb463b778c2ee53b914cd7167620950fc07faf5a564e6efe903836639e512a1aa15fbc9667fa25
15243+
languageName: node
15244+
linkType: hard
15245+
15246+
"semver@npm:^6.0.0, semver@npm:^6.3.0, semver@npm:^6.3.1":
1523815247
version: 6.3.1
1523915248
resolution: "semver@npm:6.3.1"
1524015249
bin:

0 commit comments

Comments
 (0)