Yarn v4, Typescript, Visual Studio Code

node_modules are no longer there in yarn v4, causing error "module not found" everywhere.

Configure .yarnrc.yml

  1. Add nodeLinker to .yarnrc.yml
nodeLinker: node-modules
  1. Yarn install
$ yarn install

Configure Visual Studio Code

  1. Open Command Pallete (Cmd+Shift+P) > Typescript: Select Typescript Version > Use Workspace Version

  2. Open Command Pallete (Cmd+Shift+P) > Typescript: Restart TS Server

Created 2024-02-15T13:30:04+08:00 · Edit