From bc457c13f961b56716cc99f93d2ef8ac37026a61 Mon Sep 17 00:00:00 2001 From: Brandon Siegel Date: Tue, 14 May 2019 11:57:48 -0700 Subject: [PATCH] Document file lock workaround for VSCode Windows --- README.md | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6b9e22014c8..a9f02513b81 100644 --- a/README.md +++ b/README.md @@ -81,10 +81,18 @@ Next, get the code: #### Making the switch If you have previously worked in this repo using the `npm` workflow, the first time you switch to using Rush you should commit or stash any untracked files and then get back to a clean state by running `rush reset-workspace` before proceeding any further. This will get rid of any latent package-lock files, as well as your existing (incompatible) node_modules directories. You can then proceed down the path outlined below. -#### Warning for VSCode users +#### Warnings for VSCode users Visual Studio Code has a feature which will automatically fetch and install @types packages for you, using the standard npm package manager. This will cause problems with your node_modules directory, since Rush uses PNPM which lays out this directory quite differently. It's highly recommended that you ensure "Typescript: Disable Automatic Type Acquisition" is checked in your VSCode Workspace Settings (or ensure `typescript.disableAutomaticTypeAcquisition` is present in your .vscode/settings.json file). -#### Warning for Windows users +The current version of VSCode for Windows has a bug that may cause a "file locked" error when you run any Rush command that modifies your node_modules directory: +``` +ERROR: Error: Error: EPERM: operation not permitted, mkdir 'C:\XXXXX\node_modules' +Often this is caused by a file lock from a process such as your text editor, command prompt, or "gulp serve" +``` + +This bug is fixed in the Insiders build of VSCode (1.34), and will be included in the next release. Until then, you can resolve this by running the "Typescript: Restart TS server" command from the Command Palette to release the lock on the files. + +#### Warnings for Windows users Git for Windows has a bug where repository files may be unintentionally removed by `git clean -df` when a directory is locally linked. Because Rush creates local links between packages, you may encounter this. It's highly recommended to use the `rush reset-workspace` command to get your working directory back to a clean state instead. If you prefer to run `git clean -df` manually, you must first run `rush unlink` so that the operation can be performed safely. ### Inner loop developer workflow with Rush