Open cjavad opened 4 years ago
As a side note, when using WSL with ubuntu, i can remove the node_modules files just fine with rm -rf
with no issues at all.
This only happens when trying to use the file explorer, cmd or powershell.
I guess this happens because pnpm creates hard links inside node_modules.
You can force pnpm to use copying instead, by setting the package-import-method setting to copy
.
Interestingly enough, when setting the copy directive installing single packages via pnpm seems to not create any issues. But when I tried pnpm install on a package.json from a react project then tried to delete the folder from onedrive (after a while has passed) the same issue occurs.
Might have something to do with onedrive removing the files locally when backing up.
Either way I think the obvious solution would be not to combine onedrive on demand with pnpm
is it possible to tell one drive to ignore node_modules?
You can create an empty folder called node_modules, then unselect it in Onedrive's folder selector. This doesn't apply to Onedrive configured to sync and serve on demand (when file operations are performed)
Another solution is to make the entire node_modules folder a symlink (on windows) which makes it impossible for onedrive to sync any of it, the above solution also leads to constant sync errors from onedrive.
Who ever would want to hoist deps into ... OneDrive folder!
I mean, unless OneDrive's protocol supports hard linking it's the best to avoid pnpm
's linking functionality.
As of pnpm 5.9.0 you could explore using node-linker=pnp
and symlink=false
in your .npmrc
to avoid creating all the links.
I've been having an issue with managing pnpm node_modules folders inside a onedrive directory which previously has worked fine with npm. The gist of it is that when trying to delete/move a node_modules folder from said type of directory my windows computer will blue screen, this has happened 7 times so far so i am quite confident that its this combination that causes it.
When trying to remove a pnpm node_modules folder outside of the ondrive folder it behaves as one would expect. This might be an issue with how OneDrive works, but i thought i would report it here anyhow.
pnpm version: 5.4.12
Steps to reproduce the issue:
Expected behavior:
The action would remove the folder from that location.
Actual behavior:
The explorer popup shows it's trying to remove the folder/files then subsequently blue screens.
Additional information:
node -v
prints: 14.7.0