Problem: Vite relies on creating and renaming temporary folders inside node_modules
It is not just at startup of Vite. I don't think Webpack did this. (However I have come across an equivalent problem when running npm install
, which also relies on renaming temporary folders.)
There is a more permanent solution than temporary pausing of Dropbox.
Solution: tell Dropbox to ignore the node_modules
folder
This is a good idea anyway because:
it avoids filling up your online Dropbox space with duplicative node_modules
content
it avoids unnecessary network traffic, allowing your actual source code to be sync'd sooner
you can always regenerate node_modules
on the same or different computer, that has the sync'd package.json
, by running npm install
Step 1. Run Powershell as ADMINISTRATOR
Start menu
Type "Powershell"
Right click "Windows Powershell", and select "Run as administrator"
Wait for the User Account Control window (sometimes this hides behind other windows) and approve it
Step 2. Navigate to your project folder
cd "/users/bob/dropbox/software-development/my-amazing-app/"
Step 3. Issue the Powershell command
Set-Content -Path './node_modules' -Stream com.dropbox.ignored -Value 1
Do not be alarmed if you see a lot of frantic Dropbox activity right afterwards, saying it is "Uploading files". Once it finishes this "uploading", they will be gone from the Dropbox website, and you can thereafter freely update node_modules
without any further updates being sync'd.
You can do this for multiple software projects at once
Go to the parent folder, and tell Powershell to loop through all the children folders, and tell Dropbox to ignore the node_modules
in each.
cd "/users/bob/dropbox/software-development/"
Get-ChildItem -Directory | ForEach-Object {
Set-Content -Path "$($_.FullName)/node_modules" -Stream com.dropbox.ignored -Value 1
}