Skip to content

Commit

Permalink
Update links
Browse files Browse the repository at this point in the history
  • Loading branch information
hrishikeshs committed Nov 8, 2024
1 parent 1fd9390 commit a8822db
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gitlab-node-modules-caching.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,15 +136,15 @@ build:
```
You can modify this above config to suit your needs. I had to solve a few issues when doing this on gitlab. For completeness, I'll add them below:

1. The version of npm in my project still has this open issue: https://github.com/npm/cli/issues/4828 . As we use swc to compile our tsx when running
1f. The version of npm in my project still has this open issue: [https://github.com/npm/cli/issues/4828](https://github.com/npm/cli/issues/4828) . As we use swc to compile our tsx when running
jest tests, this was causing a massive headache as our jobs would fail. I fixed this by explicitly
adding `npm install -D @swc/core --save-optional` in the `setup` job above. This is a hacky workaround, but at least now we get to use caching for the remaining
99% of the node modules we depend on. Once npm fixes this issue, I can install the proper npm version in my docker image and this hack can be removed

2. Another problem I had to solve was related to husky and the hooks it installs when it runs. We ran into this other issue:
https://github.com/typicode/husky/issues/851. I had updated my pipeline to only fetch the repo instead of cloning the whole thing
[https://github.com/typicode/husky/issues/851](https://github.com/typicode/husky/issues/851). I had updated my pipeline to only fetch the repo instead of cloning the whole thing
and husky was throwing tantrums about missing `.git` folder. After some debugging, I found that we can set the environment variable:
`HUSKY_SKIP_INSTALL` to true as per this reply: https://github.com/typicode/husky/issues/370#issuecomment-427197322 solved that
`HUSKY_SKIP_INSTALL` to true as per this reply: [https://github.com/typicode/husky/issues/370#issuecomment-427197322](https://github.com/typicode/husky/issues/370#issuecomment-427197322) solved that
issue

3. I have purposely included `cache:` in each of the jobs. Strictly speaking, this is not needed as we have artifacts already with `node_modules` passed along.
Expand Down

0 comments on commit a8822db

Please sign in to comment.